Skip to content

Commit

Permalink
Merge pull request #131 from rsevilla87/format-assets
Browse files Browse the repository at this point in the history
Format assets
  • Loading branch information
vishnuchalla authored Aug 30, 2024
2 parents 7a2fa6e + 4d9c6b7 commit d0644af
Show file tree
Hide file tree
Showing 47 changed files with 8,990 additions and 8,981 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ $(ALLDIRS):
mkdir -p $(ALLDIRS)

format: deps
$(BINDIR)/jsonnetfmt -i $(TEMPLATES)
$(BINDIR)/jsonnetfmt -i $(TEMPLATES) $(ASSETS)

build: deps $(LIBRARY_PATH) $(outputs)

Expand Down
114 changes: 57 additions & 57 deletions assets/api-performance-overview/panels.libsonnet
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet';

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

base(title, unit, targets, 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.withDrawStyle("line")
+ custom.withLineInterpolation("linear")
+ custom.withBarAlignment(0)
+ custom.withLineWidth(1)
+ custom.withFillOpacity(10)
+ custom.withGradientMode("none")
+ custom.withSpanNulls(false)
+ custom.withPointSize(5)
+ custom.withSpanNulls(false)
+ custom.stacking.withGroup("A")
+ custom.stacking.withMode("none")
+ custom.withShowPoints('never')
+ options.tooltip.withSort('desc')
+ timeSeries.queryOptions.withTimeFrom(null)
+ timeSeries.queryOptions.withTimeShift(null)
+ options.legend.withSortDesc(true),
base(title, unit, targets, 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.withDrawStyle('line')
+ custom.withLineInterpolation('linear')
+ custom.withBarAlignment(0)
+ custom.withLineWidth(1)
+ custom.withFillOpacity(10)
+ custom.withGradientMode('none')
+ custom.withSpanNulls(false)
+ custom.withPointSize(5)
+ custom.withSpanNulls(false)
+ custom.stacking.withGroup('A')
+ custom.stacking.withMode('none')
+ custom.withShowPoints('never')
+ options.tooltip.withSort('desc')
+ timeSeries.queryOptions.withTimeFrom(null)
+ timeSeries.queryOptions.withTimeShift(null)
+ options.legend.withSortDesc(true),

legendRightPlacement(title, unit, targets, gridPos):
self.base(title, unit, targets, gridPos)
+ options.legend.withCalcs([
'max'
])
+ options.legend.withShowLegend(true)
+ options.legend.withDisplayMode('table')
+ options.legend.withPlacement('right')
+ options.legend.withAsTable(true)
+ options.tooltip.withMode('multi'),
legendRightPlacement(title, unit, targets, gridPos):
self.base(title, unit, targets, gridPos)
+ options.legend.withCalcs([
'max',
])
+ options.legend.withShowLegend(true)
+ options.legend.withDisplayMode('table')
+ options.legend.withPlacement('right')
+ options.legend.withAsTable(true)
+ options.tooltip.withMode('multi'),

legendBottomPlacement(title, unit, targets, gridPos):
self.base(title, unit, targets, gridPos)
+ options.tooltip.withMode('multi')
+ options.legend.withShowLegend(true)
+ options.legend.withDisplayMode('list')
+ options.legend.withPlacement('bottom')
+ options.tooltip.withMode('multi'),
withRequestWaitDurationAggregations(title, unit, targets, gridPos):
self.legendRightPlacement(title, unit, targets, gridPos)
+ options.legend.withCalcs([
'mean',
'max',
'lastNotNull'
])
}
}
legendBottomPlacement(title, unit, targets, gridPos):
self.base(title, unit, targets, gridPos)
+ options.tooltip.withMode('multi')
+ options.legend.withShowLegend(true)
+ options.legend.withDisplayMode('list')
+ options.legend.withPlacement('bottom')
+ options.tooltip.withMode('multi'),

withRequestWaitDurationAggregations(title, unit, targets, gridPos):
self.legendRightPlacement(title, unit, targets, gridPos)
+ options.legend.withCalcs([
'mean',
'max',
'lastNotNull',
]),
},
}
Loading

0 comments on commit d0644af

Please sign in to comment.