You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eagle.apache.org by "Libin, Sun (JIRA)" <ji...@apache.org> on 2015/12/03 09:36:11 UTC
[jira] [Resolved] (EAGLE-50) Eagle internal metric framework
[ https://issues.apache.org/jira/browse/EAGLE-50?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Libin, Sun resolved EAGLE-50.
-----------------------------
Resolution: Fixed
> Eagle internal metric framework
> -------------------------------
>
> Key: EAGLE-50
> URL: https://issues.apache.org/jira/browse/EAGLE-50
> Project: Eagle
> Issue Type: Improvement
> Affects Versions: 0.3.0
> Reporter: Hao Chen
> Assignee: Libin, Sun
> Fix For: 0.3.0
>
>
> Metric Framework General Design
> MetricOperator
> {code:title=MetricOperator|theme=FadeToGrey|linenumbers=true|language=java|firstline=0001|collapse=true}
> {code}
> {code:title=MetricOperator|theme=FadeToGrey|linenumbers=true|language=java|firstline=0001|collapse=true}
> public interface MetricOperator {
> double update(double value);
> }
> {code}
> Metric
> {code:title=MetricOperator|theme=FadeToGrey|linenumbers=true|language=java|firstline=0001|collapse=true}
> public abstract class Metric implements MetricOperator {
> protected final long timestamp;
> protected final Map<String, String> dimensions;
> protected final String metricName;
> protected final AtomicDouble value;
> }
> {code}
> CountingMetric
> {code:title=MetricOperator|theme=FadeToGrey|linenumbers=true|language=java|firstline=0001|collapse=true}
> public class CountingMetric extends Metric {
> @Override
> public double update(double delta) {
> return value.addAndGet(delta);
> }
> }
> {code}
> MetricReport
> {code:title=MetricOperator|theme=FadeToGrey|linenumbers=true|language=java|firstline=0001|collapse=true}public interface MetricReport {
> void emit(List<Metric> list);
> }
> {code}
> MetricReportFactory
> {code:title=MetricOperator|theme=FadeToGrey|linenumbers=true|language=java|firstline=0001|collapse=true}
> public class MetricReportFactory {
> public MetricReport static getReportor(MetricReportType type, String ... args);
> }
> {code}
> MetricManager
> {code:title=MetricOperator|theme=FadeToGrey|linenumbers=true|language=java|firstline=0001|collapse=true}
> public class MetricManager {
> void register(String name, MetricReport report);
> Map<String, MetricReport> getRegisteredReports();
> void emit(List<Metric> list);
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)