Skip to content

Commit

Permalink
Add slab memory panels (similar to slab ratio)
Browse files Browse the repository at this point in the history
  • Loading branch information
DifferentialOrange authored and vasiliy-t committed Jun 4, 2020
1 parent 779d23a commit 82ae335
Show file tree
Hide file tree
Showing 3 changed files with 976 additions and 16 deletions.
54 changes: 48 additions & 6 deletions tarantool/dashboard.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -61,31 +61,73 @@ dashboard
version=''
)
.addPanel(
grafana.row.new(title='memory'),
{ x: 0, y: 0 }
grafana.row.new(title='Tarantool memory overview'),
{ w: 24, h: 1, x: 0, y: 0 }
)
.addPanel(
slab.monitor_info(),
{ w: 24, h: 3, x: 0, y: 0 }
{ w: 24, h: 3, x: 0, y: 1 }
)
.addPanel(
slab.quota_used_ratio(
datasource=datasource,
measurement=measurement,
),
{ w: 8, h: 8, x: 0, y: 3 }
{ w: 8, h: 8, x: 0, y: 4 }
)
.addPanel(
slab.arena_used_ratio(
datasource=datasource,
measurement=measurement,
),
{ w: 8, h: 8, x: 8, y: 3 },
{ w: 8, h: 8, x: 8, y: 4 },
)
.addPanel(
slab.items_used_ratio(
datasource=datasource,
measurement=measurement,
),
{ w: 8, h: 8, x: 16, y: 3 },
{ w: 8, h: 8, x: 16, y: 4 },
)
.addPanel(
slab.quota_used(
datasource=datasource,
measurement=measurement,
),
{ w: 8, h: 8, x: 0, y: 12 }
)
.addPanel(
slab.arena_used(
datasource=datasource,
measurement=measurement,
),
{ w: 8, h: 8, x: 8, y: 12 },
)
.addPanel(
slab.items_used(
datasource=datasource,
measurement=measurement,
),
{ w: 8, h: 8, x: 16, y: 12 },
)
.addPanel(
slab.quota_size(
datasource=datasource,
measurement=measurement,
),
{ w: 8, h: 8, x: 0, y: 20 }
)
.addPanel(
slab.arena_size(
datasource=datasource,
measurement=measurement,
),
{ w: 8, h: 8, x: 8, y: 20 },
)
.addPanel(
slab.items_size(
datasource=datasource,
measurement=measurement,
),
{ w: 8, h: 8, x: 16, y: 20 },
)
138 changes: 134 additions & 4 deletions tarantool/slab.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,21 @@ local influxdb = grafana.influxdb;
|||,
),

local used_ratio(
local used_panel(
title,
description,
datasource,
measurement,
metric_name,
format,
labelY1
) = graph.new(
title=title,
description=description,
datasource=datasource,

format='percent',
labelY1='used ratio',
format=format,
labelY1=labelY1,
fill=0,
decimals=2,
sort='decreasing',
Expand All @@ -45,6 +47,22 @@ local influxdb = grafana.influxdb;
).where('metric_name', '=', metric_name).selectField('value').addConverter('mean')
),

local used_ratio(
title,
description,
datasource,
measurement,
metric_name,
) = used_panel(
title,
description,
datasource,
measurement,
metric_name,
format='percent',
labelY1='used ratio'
),

quota_used_ratio(
title='Used by slab allocator (quota_used_ratio)',
description=|||
Expand Down Expand Up @@ -86,7 +104,7 @@ local influxdb = grafana.influxdb;
),

items_used_ratio(
title='Used only for tuples (items_used_ratio)',
title='Used for tuples (items_used_ratio)',
description=|||
`items_used_ratio` = `items_used` / `items_size`.
Expand All @@ -104,4 +122,116 @@ local influxdb = grafana.influxdb;
measurement=measurement,
metric_name='tnt_slab_items_used_ratio',
),

local used_memory(
title,
description,
datasource,
measurement,
metric_name,
) = used_panel(
title,
description,
datasource,
measurement,
metric_name,
format='bytes',
labelY1='in bytes',
),

quota_used(
title='Used by slab allocator (quota_used)',
description=|||
Memory used by slab allocator (for both tuple and index slabs).
|||,

datasource=null,
measurement=null,
):: used_memory(
title=title,
description=description,
datasource=datasource,
measurement=measurement,
metric_name='tnt_slab_quota_used',
),

quota_size(
title='Slab allocator memory limit (quota_size)',
description=|||
Memory limit for slab allocator (as configured in the *memtx_memory* parameter).
|||,

datasource=null,
measurement=null,
):: used_memory(
title=title,
description=description,
datasource=datasource,
measurement=measurement,
metric_name='tnt_slab_quota_size',
),

arena_used(
title='Used for tuples and indexes (arena_used)',
description=|||
Memory used for both tuples and indexes.
|||,

datasource=null,
measurement=null,
):: used_memory(
title=title,
description=description,
datasource=datasource,
measurement=measurement,
metric_name='tnt_slab_arena_used',
),

arena_size(
title='Allocated for tuples and indexes (arena_size)',
description=|||
Memory allocated for both tuples and indexes by slab allocator.
|||,

datasource=null,
measurement=null,
):: used_memory(
title=title,
description=description,
datasource=datasource,
measurement=measurement,
metric_name='tnt_slab_arena_size',
),

items_used(
title='Used for tuples (items_used)',
description=|||
Memory used for only tuples.
|||,

datasource=null,
measurement=null,
):: used_memory(
title=title,
description=description,
datasource=datasource,
measurement=measurement,
metric_name='tnt_slab_items_used',
),

items_size(
title='Allocated for tuples (items_size)',
description=|||
Memory allocated for only tuples by slab allocator.
|||,

datasource=null,
measurement=null,
):: used_memory(
title=title,
description=description,
datasource=datasource,
measurement=measurement,
metric_name='tnt_slab_items_size',
),
}
Loading

0 comments on commit 82ae335

Please sign in to comment.