Skip to content

Commit

Permalink
fix: better memory usage graph
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Oct 31, 2018
1 parent 42e689c commit 9d23c33
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion collector/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ func NewBucketsCollector(client client.Client) prometheus.Collector {
nil,
),
statsEpMaxSize: prometheus.NewDesc(
prometheus.BuildFQName(namespace, subsystem, "stats_ep_max_size"),
prometheus.BuildFQName(namespace, subsystem, "stats_ep_max_size_bytes"),
"The maximum amount of memory this bucket can use",
[]string{"bucket"},
nil,
Expand Down
29 changes: 14 additions & 15 deletions grafana/dashboard.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ dashboard.new(
)
.addTarget(
prometheus.target(
'avg(100 * (sum by (bucket) (couchbase_bucket_basicstats_memused_bytes{bucket=~"$bucket",instance=~"$instance"})) / sum by (bucket) (couchbase_bucket_stats_ep_max_size{bucket=~"$bucket",instance=~"$instance"}))',
'avg(100 * (sum by (bucket) (couchbase_bucket_basicstats_memused_bytes{bucket=~"$bucket",instance=~"$instance"})) / sum by (bucket) (couchbase_bucket_stats_ep_max_size_bytes{bucket=~"$bucket",instance=~"$instance"}))',
)
)
)
Expand Down Expand Up @@ -327,27 +327,26 @@ dashboard.new(
legend_current=true,
legend_sort='current',
legend_sortDesc=true,
format='decbytes',
format='percent',
min=0,
max=100,
thresholds=[
{
"value": 90,
"colorMode": "critical",
"op": "gt",
"fill": true,
"line": true,
"yaxis": "left"
}
],
)
.addTarget(
prometheus.target(
'couchbase_bucket_basicstats_memused_bytes{bucket=~"$bucket",instance=~"$instance"}',
'100 * couchbase_bucket_basicstats_memused_bytes{bucket=~"$bucket",instance=~"$instance"} / couchbase_bucket_stats_ep_max_size_bytes',
legendFormat='{{ bucket }}.Usage',
)
)
.addTarget(
prometheus.target(
'couchbase_bucket_stats_ep_mem_high_wat_bytes{bucket=~"$bucket",instance=~"$instance"}',
legendFormat='{{ bucket }}.HighWatermark',
)
)
.addTarget(
prometheus.target(
'couchbase_bucket_stats_ep_mem_low_wat_bytes{bucket=~"$bucket",instance=~"$instance"}',
legendFormat='{{ bucket }}.LowWatermark',
)
)
)
.addPanel(
graphPanel.new(
Expand Down

0 comments on commit 9d23c33

Please sign in to comment.