Skip to content
This repository has been archived by the owner on Jan 8, 2019. It is now read-only.

Commit

Permalink
Add COUNTER metric type. Fixes Graylog2/graylog2-server#795.
Browse files Browse the repository at this point in the history
  • Loading branch information
bernd committed Dec 4, 2014
1 parent 6eb39d4 commit 141f017
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/assets/stylesheets/graylog2.less
Expand Up @@ -1298,6 +1298,10 @@ dl.metric-gauge dd {
margin-left: 80px;
}

dl.metric-counter dd {
margin-left: 80px;
}

dl.metric-histogram dd {
margin-left: 125px;
}
Expand Down
6 changes: 6 additions & 0 deletions app/views/partials/metrics/counter.scala.html
@@ -0,0 +1,6 @@
@(counter: org.graylog2.restclient.lib.metrics.Counter)

<dl class="metric-def metric-counter">
<dt>Value:</dt>
<dd>@counter.getCount</dd>
</dl>
4 changes: 4 additions & 0 deletions app/views/system/metrics/of_node.scala.html
Expand Up @@ -40,6 +40,10 @@ <h1>
<i class="icon icon-dashboard"></i>
}

@if(metric.getType.equals(Metric.MetricType.COUNTER)) {
<i class="icon icon-circle"></i>
}

<a href="#" class="open" data-metricname="@name">
<span class="prefix">@name.substring(0,"org.graylog2.".length)</span>@name.substring("org.graylog2.".length)
</a>
Expand Down
5 changes: 5 additions & 0 deletions app/views/system/metrics/partials/metric.scala.html
Expand Up @@ -15,6 +15,11 @@ <h3 class="u-light" style="display: inline;">Gauge</h3><br />
@views.html.partials.metrics.gauge(metric.asInstanceOf[Gauge])
}

@if(metric.getType.equals(Metric.MetricType.COUNTER)) {
<h3 class="u-light" style="display: inline;">Counter</h3><br />
@views.html.partials.metrics.counter(metric.asInstanceOf[Counter])
}

@if(metric.getType.equals(Metric.MetricType.HISTOGRAM)) {
<h3 class="u-light" style="display: inline;">Histogram</h3><br />
@views.html.partials.metrics.histogram(metric.asInstanceOf[Histogram])
Expand Down

0 comments on commit 141f017

Please sign in to comment.