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

Add back mixerclient stats #1119

Merged
merged 7 commits into from
Feb 14, 2018

Conversation

JimmyCYJ
Copy link
Member

@JimmyCYJ JimmyCYJ commented Feb 14, 2018

What this PR does / why we need it:Revert Mixerclient stats back.
Move Envoy stats into Mixer filter config object.
Keep MixerStatsObject in HttpMixerControl and TcpMixerControl, and pass Envoy stats into MixerStatsObject for periodical stats update.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #132 istio/old_mixerclient_repo#132

Special notes for your reviewer:

Release note:

NONE

@googlebot googlebot added the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label Feb 14, 2018
@qiwzhang qiwzhang changed the title Revert mixerclient stats Add back mixerclient stats Feb 14, 2018
public:
MixerStatsObject(Event::Dispatcher& dispatcher,
::google::protobuf::Duration update_interval,
GetStatsFunc func, MixerFilterStats& stats);
Copy link
Contributor

Choose a reason for hiding this comment

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

Put all these "T&" arguments first. move "stats" right after dispatcher

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@qiwzhang
Copy link
Contributor

Could you do a manual stress test of Envoy with --concurrent=100 to see if it crash?

@JimmyCYJ
Copy link
Member Author

Please take a look. Thanks!

void CheckAndUpdateStats(const ::istio::mixer_client::Statistics& new_stats);

// A set of Envoy stats for the number of check, quota and report calls.
MixerFilterStats stats_;
Copy link
Contributor

Choose a reason for hiding this comment

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

It is better to use &. Here you are making a copy. I am not sure of a copy of references, or a copy of the stat slots?

Copy link
Member Author

Choose a reason for hiding this comment

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

It should be a reference, not a copy. Thanks!

@qiwzhang
Copy link
Contributor

/lgtm
/approve

@istio-merge-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qiwzhang

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@istio-merge-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@istio-merge-robot
Copy link

Automatic merge from submit-queue.

@istio-merge-robot istio-merge-robot merged commit e120c24 into istio:master Feb 14, 2018
@JimmyCYJ JimmyCYJ deleted the revert-mixerclient-stats branch February 14, 2018 22:48
@ldemailly
Copy link
Member

ldemailly commented Feb 15, 2018

hey @JimmyCYJ, thanks a lot for this - quick question:

what is different between this version and the one that was crashing before ?
why was it crashing before ?

@qiwzhang
Copy link
Contributor

The place allocating "stat" struct is different. "stat" is thread local data. Before it was allocated on top of another thread local data. This is the case Envoy doesn't support. Now the change is to allocate it on the Config, which is not thread local data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants