Skip to content

Commit

Permalink
Merge pull request #114 from smandaRH/hypershift-perf
Browse files Browse the repository at this point in the history
Adding Hyepershift Performance Dashboard to Grafonnet
  • Loading branch information
vishnuchalla authored Mar 26, 2024
2 parents c9eaf01 + 6c615b5 commit c4f3c45
Show file tree
Hide file tree
Showing 5 changed files with 1,486 additions and 3 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ rm -rf bin rendered tmp templates/grafonnet-lib

## Templates available

The following templates are available:

Dashboards Available after Migration to Grafonnet v10.1.0(latest):
- CPT
- [x] Ingress Perf Dashboard.
- [x] K8s Netperf Dashboard.
Expand All @@ -79,7 +78,7 @@ The following templates are available:
- [x] API Performance Dashboard.
- [x] Cilium K8s Performance Dashboard.
- [x] Etcd Dashboard.
- [ ] Hypershift Performance Dashboard.
- [x] Hypershift Performance Dashboard.
- [x] K8s Performance Dashboard.
- [ ] Kube Burner Dashboard.
- [x] OpenShift Performance Dashboard.
Expand Down
229 changes: 229 additions & 0 deletions assets/hypershift-perf-dashboard/panels.libsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet';

{
stat: {
local stat = g.panel.stat,
local options = stat.options,

base(title, unit, targets, datasource, gridPos):
stat.new(title)
+ stat.datasource.withType('prometheus')
+ stat.datasource.withUid(datasource)
+ stat.standardOptions.withUnit(unit)
+ stat.queryOptions.withTargets(targets)
+ stat.gridPos.withX(gridPos.x)
+ stat.gridPos.withY(gridPos.y)
+ stat.gridPos.withH(gridPos.h)
+ stat.gridPos.withW(gridPos.w)
+ options.withJustifyMode("auto")
+ options.withGraphMode("none")
+ options.text.withTitleSize(12),

m_infrastructure(title, unit, targets, datasource, gridPos):
self.base(title, unit, targets, datasource, gridPos)
+ options.withTextMode('name')
+ options.withColorMode('value')
+ stat.standardOptions.thresholds.withSteps([{
"color": "green",
"value": null
}])
+ options.withJustifyMode('auto'),

m_region(title, unit, targets, datasource, gridPos):
self.base(title, unit, targets, datasource, gridPos)
+ options.withTextMode('name')
+ options.withColorMode('value')
+ stat.standardOptions.thresholds.withSteps([{
"color": "green",
"value": null
}])
+ options.withJustifyMode('auto'),

m_ocp_version(title, unit, targets, datasource, gridPos):
self.base(title, unit, targets, datasource, gridPos)
+ options.withTextMode('name')
+ options.withColorMode('value')
+ stat.standardOptions.thresholds.withSteps([{
"color": "green",
"value": null
}])
+ options.withJustifyMode('auto'),

num_hosted_cluster(title, unit, targets, datasource, gridPos):
self.base(title, unit, targets, datasource, gridPos)
+ options.withTextMode('auto')
+ options.withColorMode('value')
+ options.withJustifyMode('auto')
+ stat.standardOptions.thresholds.withSteps([{
"color": "green",
"value": null
}])
+ options.reduceOptions.withCalcs([
'max',
]),

current_namespace_count(title, unit, targets, datasource, gridPos):
self.base(title, unit, targets, datasource, gridPos)
+ options.withTextMode('auto')
+ options.withColorMode('value')
+ options.withJustifyMode('auto')
+ stat.standardOptions.thresholds.withSteps([])
+ stat.standardOptions.thresholds.withMode('absolute')
+ options.reduceOptions.withCalcs([
'last',
]),

current_node_count(title, unit, targets, datasource, gridPos):
self.base(title, unit, targets, datasource, gridPos)
+ options.withTextMode('auto')
+ options.withColorMode('value')
+ options.withJustifyMode('auto')
+ options.withGraphMode('area')
+ stat.standardOptions.thresholds.withSteps([])
+ stat.standardOptions.thresholds.withMode('absolute')
+ options.reduceOptions.withCalcs([
'last',
]),

current_pod_count(title, unit, targets, datasource, gridPos):
self.base(title, unit, targets, datasource, gridPos)
+ options.withTextMode('auto')
+ options.withColorMode('value')
+ options.withJustifyMode('auto')
+ options.withGraphMode('area')
+ stat.standardOptions.thresholds.withSteps([])
+ stat.standardOptions.thresholds.withMode('absolute')
+ options.reduceOptions.withCalcs([
'last',
]),

etcd_has_leader(title, unit, targets, datasource, gridPos):
self.base(title, unit, targets, datasource, gridPos)
+ options.withOrientation('horizontal')
+ options.withColorMode('none')
+ stat.standardOptions.withMappings([
{
"type": "value",
"options": {
"0": {
"text": "NO"
},
"1": {
"text": "YES"
}
}
}
]),

mgmt_num_failed_proposals(title, unit, targets, datasource, gridPos):
self.base(title, unit, targets, datasource, gridPos)
+ options.withOrientation('horizontal')
+ options.withColorMode('none')
+ options.withTextMode('auto')
+ options.withGraphMode('none')
+ options.withJustifyMode('auto'),

hostedControlPlaneStats(title, unit, targets, datasource, gridPos):
self.base(title, unit, targets, datasource, gridPos)
+ options.withTextMode('name')
+ options.withColorMode('value')
+ options.withJustifyMode('auto')
+ options.withGraphMode('none')
+ stat.standardOptions.thresholds.withSteps([{
"color": "green",
"value": null
}]),
},

timeSeries: {
local timeSeries = g.panel.timeSeries,
local custom = timeSeries.fieldConfig.defaults.custom,
local options = timeSeries.options,

base(title, unit, targets, datasource, gridPos):
timeSeries.new(title)
+ timeSeries.queryOptions.withTargets(targets)
+ timeSeries.datasource.withType('prometheus')
+ timeSeries.datasource.withUid(datasource)
+ timeSeries.standardOptions.withUnit(unit)
+ timeSeries.gridPos.withX(gridPos.x)
+ timeSeries.gridPos.withY(gridPos.y)
+ timeSeries.gridPos.withH(gridPos.h)
+ timeSeries.gridPos.withW(gridPos.w)
+ custom.withSpanNulls(false)
+ custom.withFillOpacity(25)
+ options.legend.withShowLegend(true),

managementClustersStatsTimeseriesSettings(title, unit, targets, datasource, gridPos):
self.base(title, unit, targets, datasource, gridPos)
+ options.legend.withPlacement('bottom')
+ options.legend.withDisplayMode('table')
+ options.tooltip.withMode('multi')
+ options.tooltip.withSort('desc')
+ custom.withDrawStyle('line')
+ custom.withLineInterpolation('linear')
+ options.legend.withDisplayMode('table')
+ options.legend.withCalcs([
'mean',
'max'
]),

mgmt(title, unit, targets, datasource, gridPos):
self.base(title, unit, targets, datasource, gridPos)
+ options.legend.withDisplayMode('table')
+ options.legend.withShowLegend(true)
+ options.legend.withPlacement('bottom')
+ options.legend.withCalcs([
'mean',
'max'
])
+ options.tooltip.withMode('multi')
+ options.tooltip.withSort('desc')
+ options.legend.withSortBy('max'),

DBPanelsSettings(title, unit, targets, datasource, gridPos):
self.base(title, unit, targets, datasource, gridPos)
+ options.legend.withDisplayMode('list')
+ options.legend.withShowLegend(true)
+ options.legend.withPlacement('bottom')
+ options.tooltip.withMode('multi')
+ options.tooltip.withSort('none'),

genericGraphLegendPanel(title, unit, targets, datasource, gridPos):
self.base(title, unit, targets, datasource, gridPos)
+ options.legend.withDisplayMode('table')
+ options.legend.withShowLegend(true)
+ options.legend.withPlacement('bottom')
+ options.legend.withCalcs([
'mean',
'max'
])
+ options.tooltip.withMode('multi')
+ options.tooltip.withSort('desc')
+ options.legend.withSortBy('max'),

genericGraphLegendPanelRightSide(title, unit, targets, datasource, gridPos):
self.base(title, unit, targets, datasource, gridPos)
+ options.legend.withDisplayMode('table')
+ options.legend.withShowLegend(true)
+ options.legend.withPlacement('right')
+ options.legend.withCalcs([
'lastNotNull',
])
+ options.tooltip.withMode('multi')
+ options.tooltip.withSort('desc')
+ options.legend.withSortBy('max'),

genericGraphLegendPanelList(title, unit, targets, datasource, gridPos):
self.base(title, unit, targets, datasource, gridPos)
+ options.legend.withDisplayMode('list')
+ options.legend.withShowLegend(true)
+ options.legend.withPlacement('bottom')
+ options.legend.withCalcs([
'lastNotNull',
])
+ options.tooltip.withMode('multi')
+ options.tooltip.withSort('desc')
+ options.legend.withSortBy('max'),
},
}
Loading

0 comments on commit c4f3c45

Please sign in to comment.