Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing pipedstat model #2261

Merged
merged 5 commits into from Jul 19, 2021
Merged

Introducing pipedstat model #2261

merged 5 commits into from Jul 19, 2021

Conversation

khanhtc1202
Copy link
Member

@khanhtc1202 khanhtc1202 commented Jul 16, 2021

What this PR does / why we need it:

  • Mark PipedStats model as deprecated
  • Introduce PipedStat model which wraps piped stat data with timestamp value. The timestamp value will be used to filter out outdated piped stat on expose
  • Remove TTLHashCache constructor, since we will not expire value of hashkey by the cache itself but make it in application layer (address it later).

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

NONE

Copy link
Collaborator

@pipecd-bot pipecd-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GO_LINTER

Some issues were detected while linting go source files in your changes.

pkg/datastore/pipedstatsstore.go Show resolved Hide resolved
pkg/datastore/pipedstatsstore.go Show resolved Hide resolved
@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 31.68%. This pull request decreases coverage by -0.01%.

File Function Base Head Diff
pkg/app/api/grpcapi/piped_api.go PipedAPI.ReportStat 0.00% 0.00% +0.00%

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 31.69%. This pull request decreases coverage by -0.00%.

File Function Base Head Diff
pkg/app/api/grpcapi/piped_api.go PipedAPI.ReportStat 0.00% 0.00% +0.00%
pkg/app/ops/pipedstatsbuilder/builder.go PipedStatsBuilder.Build 61.54% 58.82% -2.71%
pkg/cache/rediscache/hashcache.go NewTTLHashCache 0.00% -- +-0.00%

@khanhtc1202 khanhtc1202 changed the title WIP Intruducing pipedstat model Intruducing pipedstat model Jul 19, 2021
@nghialv
Copy link
Member

nghialv commented Jul 19, 2021

typo in the PR title

Intruducing

@khanhtc1202 khanhtc1202 changed the title Intruducing pipedstat model Introducing pipedstat model Jul 19, 2021

import "validate/validate.proto";

message PipedStat {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding PipedID into this message?
I know we are having that ID from the map key but ID inside its data could be helpful as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure 👍 Btw I'm thinking about the current model name, just want to make it PipedMetrics. In that case, PipedMetrics.PipedID and PipedMetrics.Stat looks better than PipedStat.PipedID and PipedStat.Stat as currently. Just wonder is that name too generics or something 🤔 How do you think about that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think PipedMetrics is good too. But currently, our RPC name is Report...Stats, right?
So maybe we should keep that model name as PipedStat and change its Stat field to Metrics.
Or we can reuse the old PipedStats model, deprecate unused fields and add new fields like PipedID, Metrics.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So maybe we should keep that model name as PipedStat and change its Stat field to Metrics.

Get your point, lets me adopt this 👍 ( Personally don't think the name should be XXXStats since this message covers only a single value of piped committed stat at a time )

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed by ae07feb 🙏

@pipecd-bot
Copy link
Collaborator

TODO

The following ISSUES will be created once got merged. If you want me to skip creating the issue, you can use /todo skip command.

Details

1. Filter returning piped metrics by value timestamp.

https://github.com/pipe-cd/pipe/blob/ae07febc5c251a1f385208128da01fb9abe14aeb/pkg/app/ops/pipedstatsbuilder/builder.go#L60-L63

This was created by todo plugin since "TODO:" was found in ae07feb when #2261 was merged. cc: @khanhtc1202.

@khanhtc1202
Copy link
Member Author

/todo skip

@nakabonne
Copy link
Member

Cool
/lgtm

@nghialv
Copy link
Member

nghialv commented Jul 19, 2021

/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by nghialv.

Approvers can cancel the approval by writing /approve cancel in a comment. Any additional commits also will change this pull request to be not-approved.

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 31.69%. This pull request decreases coverage by -0.00%.

File Function Base Head Diff
pkg/app/api/grpcapi/piped_api.go PipedAPI.ReportStat 0.00% 0.00% +0.00%
pkg/app/ops/pipedstatsbuilder/builder.go PipedStatsBuilder.Build 61.54% 58.82% -2.71%
pkg/cache/rediscache/hashcache.go NewTTLHashCache 0.00% -- +-0.00%

@pipecd-bot pipecd-bot merged commit 52bc98f into master Jul 19, 2021
@pipecd-bot pipecd-bot deleted the intruducing-pipedstat-model branch July 19, 2021 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants