Skip to content

Add back mixerclient stats#1119

Merged
istio-merge-robot merged 7 commits intoistio:masterfrom
JimmyCYJ:revert-mixerclient-stats
Feb 14, 2018
Merged

Add back mixerclient stats#1119
istio-merge-robot merged 7 commits intoistio:masterfrom
JimmyCYJ:revert-mixerclient-stats

Conversation

@JimmyCYJ
Copy link
Copy Markdown
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
@JimmyCYJ JimmyCYJ requested a review from qiwzhang February 14, 2018 00:22
@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

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

@JimmyCYJ
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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!

@JimmyCYJ JimmyCYJ force-pushed the revert-mixerclient-stats branch from b268ff8 to 421faf1 Compare February 14, 2018 19:45
@qiwzhang
Copy link
Copy Markdown
Contributor

/lgtm
/approve

@istio-merge-robot
Copy link
Copy Markdown

[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.

Details 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
Copy Markdown

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

@istio-merge-robot
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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