Skip to content

[SCB-327] Update metrics publish data module#550

Closed
zhengyangyong wants to merge 18 commits into
apache:masterfrom
zhengyangyong:SCB-327
Closed

[SCB-327] Update metrics publish data module#550
zhengyangyong wants to merge 18 commits into
apache:masterfrom
zhengyangyong:SCB-327

Conversation

@zhengyangyong
Copy link
Copy Markdown

@zhengyangyong zhengyangyong commented Feb 6, 2018

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a JIRA issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [SCB-XXX] Fixes bug in ApproximateQuantiles, where you replace SCB-XXX with the appropriate JIRA issue.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean install to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

adjust metrics publish format to spring cloud netflix style
Before:
servicecomb.instance.system.cpu.load
servicecomb.instance.system.cpu.runningThreads
servicecomb.instance.system.heap.init
servicecomb.instance.system.heap.max
servicecomb.instance.system.heap.commit
servicecomb.instance.system.heap.used
servicecomb.instance.system.nonHeap.init
servicecomb.instance.system.nonHeap.max
servicecomb.instance.system.nonHeap.commit
servicecomb.instance.system.nonHeap.used
servicecomb.instance | operationName.producer.waitInQueue.count
servicecomb.instance | operationName.producer.lifeTimeInQueue.average
servicecomb.instance | operationName.producer.lifeTimeInQueue.max
servicecomb.instance | operationName.producer.lifeTimeInQueue.min
servicecomb.instance | operationName.producer.executionTime.average
servicecomb.instance | operationName.producer.executionTime.max
servicecomb.instance | operationName.producer.executionTime.min
servicecomb.instance | operationName.producer.producerLatency.average
servicecomb.instance | operationName.producer.producerLatency.max
servicecomb.instance | operationName.producer.producerLatency.min
servicecomb.instance | operationName.producer.producerCall.total
servicecomb.instance | operationName.producer.producerCall.tps
servicecomb.instance | operationName.consumer.consumerLatency.average
servicecomb.instance | operationName.consumer.consumerLatency.max
servicecomb.instance | operationName.consumer.consumerLatency.min
servicecomb.instance | operationName.consumer.consumerCall.total
servicecomb.instance | operationName.consumer.consumerCall.tps

Current:
jvm(statistic=gauge,name={name})
{name} include :
cpuLoad,cpuRunningThreads,heapInit,heapMax,heapCommit,
heapUsed,nonHeapInit,nonHeapMax,nonHeapCommit,nonHeapUsed

servicecomb.invocation(operation={operationName},role={role},stage={stage},statistic={statistic},status={status})

TagName TagValue
operation Operation Name
role consume,producer
stage queue,execution,whole
statistic tps,totalCount,count,totalTime,max,waitInQueue (can compute latency = totalTime/count)
status statusCode like 200, 404 ... etc

A output sample:
tim 20180206161636

@coveralls
Copy link
Copy Markdown

coveralls commented Feb 6, 2018

Coverage Status

Coverage increased (+0.09%) to 87.326% when pulling cc2ba53 on zhengyangyong:SCB-327 into cfc66b9 on apache:master.

@zhengyangyong
Copy link
Copy Markdown
Author

Rebase and resolved conflicts

tps.increment();
}

public Map<String, Double> measure(int windowTimeIndex) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we still need to support window time here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think we may remove this feature later

this.appliedWindowTimes.put(appliedWindowTimes.get(i), i);

List<Long> sortedPollingSettings = Lists.newArrayList(parsePollingSettings);
System.getProperties().setProperty("servo.pollers", Strings.join(",", sortedPollingSettings.iterator()));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's not good way to set the system properties here (as it could be overridden anytime), can we setup the servo poller directly?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

it seems servo read and parse this setting use System.getPropert;
Could not find another way yet.

zhengyangyong added 9 commits February 10, 2018 08:37
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
…h code (200,500... etc)

Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
import java.util.List;
import java.util.Map;

public class Metric {
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.

why wrap another class?
Metric just equals Measurement......

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

we do not import spectator in current version;
this class had parse metric output id into name and tag map,easy use for grouping

package org.apache.servicecomb.metrics.common;

import java.util.List;
import java.util.Map;
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.

common move to foundation-metrics

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

metrics-common had deleted and move all content into foundation-metrics

* @return RegistryMetric
*/
RegistryMetric metricsWithWindowTime(long windowTime);
Map<String, Double> metrics();
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.

why we need this interface?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done,deleted

…foundation-metrics

Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
zhengyangyong added 8 commits February 11, 2018 13:13
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
…n-metrics

Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
…er to prevent low-probability test failed on ci

Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
@zhengyangyong zhengyangyong deleted the SCB-327 branch March 27, 2018 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants