{
// 'description' 'Dashboard test'
'type' 'flex' // 'scada' or 'dashboard' or 'flex';
'cellHeight' 220
'timeZone' 'AUTO'
'options' {
'autoRefresh' 60
'showControls' T
'showLoader' T
}
'tiles' [
// Stat Monday
{
'title' 'Stat Monday'
'type' 'line'
'w' 12
'h' 2
'macro' <%
// @preview gts
// ## Code des compteurs
//
// - BARDONNEX (AR): CH:0200.xx xx=[01-06]
// - PLAN-LES-OUAT. (AR): CH:0224.xx xx=[01-04]
// - PONT DU RHONE (AR) CH:0272.xx [01-04]
// - COLOVREX-AEROPORT (AR) CH:0069 [01-04]
// - COLOVREX-LAC (AR) CH:0068 [01-04]
#############################################
## Fetch data
{
'token' "readToken"
'class' "~trafic.traffic-speed"
'labels' { "site_id" "~CH:0224.0[12]" }
'start' "2025-02-01T00:00:00.000Z"
'end' NOW // "2025-03-11T22:00:00.000Z"
} FETCH
'Europe/Paris' @senx/cal/bydayofweek
# Cut the data in 1 day slices
1 d 1 'split' TIMESPLIT
# As TIMESPLIT create an array of array grouped by day, we need to flatten it
FLATTEN
'list_of_days' STORE
#############################################
## Filter data
<%
SAVE 'context' STORE # Keep the stack but save all stored value linke $list_of_days
# Don't care about saturday and sunday .dayofweek < 6
1 == # Just keep days where .dayofweek < 6 or just one day : 1 == for monday, 2 == for tuesday ...
$context RESTORE
%> 'accept_day' STORE
$list_of_days
<%
LABELS '.dayofweek' GET TOLONG
@accept_day
%>
FILTERBY
#############################################
## All in same time window
1 d 'split' TIMEMODULO
FLATTEN
'list_of_days' STORE
#############################################
## Improve labels to understand a bit more
<%
SAVE 'context' STORE # Keep the stack but save all stored value linke $list_of_days
'gts' STORE
# Below, get the $date variable by processing split lable
$gts
LABELS 'split' GET TOLONG # Get the quotient of the modulo operation
1 d * # Map the quotient to ts
ISO8601 # Convert to ISO8601
0 10 SUBSTRING # keep the date only
'date' STORE
# Add the date to the labels
$gts { 'date' $date } RELABEL
$context RESTORE
%> 'give_iso_day_as_label' STORE
$list_of_days
<%
DROP // drop the index
@give_iso_day_as_label
%> LMAP
[ 'date' ] METASORT
'list_of_days' STORE
#############################################
## Show 1,25,50,75,99 percentiles
$list_of_days
[ SWAP bucketizer.mean 0 20 m 0 ] BUCKETIZE
'list_of_days' STORE
[
$list_of_days [ SWAP [] 99.0 reducer.percentile ] REDUCE { 'percentile' '0.99' } RELABEL
$list_of_days [ SWAP [] 75.0 reducer.percentile ] REDUCE { 'percentile' '0.75' } RELABEL
$list_of_days [ SWAP [] 50.0 reducer.percentile ] REDUCE { 'percentile' '0.50' } RELABEL
$list_of_days [ SWAP [] 25.0 reducer.percentile ] REDUCE { 'percentile' '0.25' } RELABEL
$list_of_days [ SWAP [] 1.0 reducer.percentile ] REDUCE { 'percentile' '0.10' } RELABEL
] FLATTEN
//
//
//
//[ SWAP [ '.dayofweek' ] reducer.mean.exclude-nulls ] REDUCE
//
//'mean by day' RENAME
// [ SWAP bucketizer.mean 0 20 m 0 ] BUCKETIZE 0 GET
//
// 1 d 'split' TIMEMODULO
%>
}
// Stat Tuesday
{
'title' 'Stat Tuesday'
'type' 'line'
'w' 12
'h' 2
'macro' <%
// @preview gts
// ## Code des compteurs
//
// - BARDONNEX (AR): CH:0200.xx xx=[01-06]
// - PLAN-LES-OUAT. (AR): CH:0224.xx xx=[01-04]
// - PONT DU RHONE (AR) CH:0272.xx [01-04]
// - COLOVREX-AEROPORT (AR) CH:0069 [01-04]
// - COLOVREX-LAC (AR) CH:0068 [01-04]
#############################################
## Fetch data
{
'token' "readToken"
'class' "~trafic.traffic-speed"
'labels' { "site_id" "~CH:0224.0[12]" }
'start' "2025-02-01T00:00:00.000Z"
'end' NOW // "2025-03-11T22:00:00.000Z"
} FETCH
'Europe/Paris' @senx/cal/bydayofweek
# Cut the data in 1 day slices
1 d 1 'split' TIMESPLIT
# As TIMESPLIT create an array of array grouped by day, we need to flatten it
FLATTEN
'list_of_days' STORE
#############################################
## Filter data
<%
SAVE 'context' STORE # Keep the stack but save all stored value linke $list_of_days
# Don't care about saturday and sunday .dayofweek < 6
2 == # Just keep days where .dayofweek < 6 or just one day : 1 == for monday, 2 == for tuesday ...
$context RESTORE
%> 'accept_day' STORE
$list_of_days
<%
LABELS '.dayofweek' GET TOLONG
@accept_day
%>
FILTERBY
#############################################
## All in same time window
1 d 'split' TIMEMODULO
FLATTEN
'list_of_days' STORE
#############################################
## Improve labels to understand a bit more
<%
SAVE 'context' STORE # Keep the stack but save all stored value linke $list_of_days
'gts' STORE
# Below, get the $date variable by processing split lable
$gts
LABELS 'split' GET TOLONG # Get the quotient of the modulo operation
1 d * # Map the quotient to ts
ISO8601 # Convert to ISO8601
0 10 SUBSTRING # keep the date only
'date' STORE
# Add the date to the labels
$gts { 'date' $date } RELABEL
$context RESTORE
%> 'give_iso_day_as_label' STORE
$list_of_days
<%
DROP // drop the index
@give_iso_day_as_label
%> LMAP
[ 'date' ] METASORT
'list_of_days' STORE
#############################################
## Show 1,25,50,75,99 percentiles
$list_of_days
[ SWAP bucketizer.mean 0 20 m 0 ] BUCKETIZE
'list_of_days' STORE
[
$list_of_days [ SWAP [] 99.0 reducer.percentile ] REDUCE { 'percentile' '0.99' } RELABEL
$list_of_days [ SWAP [] 75.0 reducer.percentile ] REDUCE { 'percentile' '0.75' } RELABEL
$list_of_days [ SWAP [] 50.0 reducer.percentile ] REDUCE { 'percentile' '0.50' } RELABEL
$list_of_days [ SWAP [] 25.0 reducer.percentile ] REDUCE { 'percentile' '0.25' } RELABEL
$list_of_days [ SWAP [] 1.0 reducer.percentile ] REDUCE { 'percentile' '0.10' } RELABEL
] FLATTEN
//
//
//
//[ SWAP [ '.dayofweek' ] reducer.mean.exclude-nulls ] REDUCE
//
//'mean by day' RENAME
// [ SWAP bucketizer.mean 0 20 m 0 ] BUCKETIZE 0 GET
//
// 1 d 'split' TIMEMODULO
%>
}
// Stat Wednesday
{
'title' 'Stat Wednesday'
'type' 'line'
'w' 12
'h' 2
'macro' <%
// @preview gts
// ## Code des compteurs
//
// - BARDONNEX (AR): CH:0200.xx xx=[01-06]
// - PLAN-LES-OUAT. (AR): CH:0224.xx xx=[01-04]
// - PONT DU RHONE (AR) CH:0272.xx [01-04]
// - COLOVREX-AEROPORT (AR) CH:0069 [01-04]
// - COLOVREX-LAC (AR) CH:0068 [01-04]
#############################################
## Fetch data
{
'token' "readToken"
'class' "~trafic.traffic-speed"
'labels' { "site_id" "~CH:0224.0[12]" }
'start' "2025-02-01T00:00:00.000Z"
'end' NOW // "2025-03-11T22:00:00.000Z"
} FETCH
'Europe/Paris' @senx/cal/bydayofweek
# Cut the data in 1 day slices
1 d 1 'split' TIMESPLIT
# As TIMESPLIT create an array of array grouped by day, we need to flatten it
FLATTEN
'list_of_days' STORE
#############################################
## Filter data
<%
SAVE 'context' STORE # Keep the stack but save all stored value linke $list_of_days
# Don't care about saturday and sunday .dayofweek < 6
3 == # Just keep days where .dayofweek < 6 or just one day : 1 == for monday, 2 == for tuesday ...
$context RESTORE
%> 'accept_day' STORE
$list_of_days
<%
LABELS '.dayofweek' GET TOLONG
@accept_day
%>
FILTERBY
#############################################
## All in same time window
1 d 'split' TIMEMODULO
FLATTEN
'list_of_days' STORE
#############################################
## Improve labels to understand a bit more
<%
SAVE 'context' STORE # Keep the stack but save all stored value linke $list_of_days
'gts' STORE
# Below, get the $date variable by processing split lable
$gts
LABELS 'split' GET TOLONG # Get the quotient of the modulo operation
1 d * # Map the quotient to ts
ISO8601 # Convert to ISO8601
0 10 SUBSTRING # keep the date only
'date' STORE
# Add the date to the labels
$gts { 'date' $date } RELABEL
$context RESTORE
%> 'give_iso_day_as_label' STORE
$list_of_days
<%
DROP // drop the index
@give_iso_day_as_label
%> LMAP
[ 'date' ] METASORT
'list_of_days' STORE
#############################################
## Show 1,25,50,75,99 percentiles
$list_of_days
[ SWAP bucketizer.mean 0 20 m 0 ] BUCKETIZE
'list_of_days' STORE
[
$list_of_days [ SWAP [] 99.0 reducer.percentile ] REDUCE { 'percentile' '0.99' } RELABEL
$list_of_days [ SWAP [] 75.0 reducer.percentile ] REDUCE { 'percentile' '0.75' } RELABEL
$list_of_days [ SWAP [] 50.0 reducer.percentile ] REDUCE { 'percentile' '0.50' } RELABEL
$list_of_days [ SWAP [] 25.0 reducer.percentile ] REDUCE { 'percentile' '0.25' } RELABEL
$list_of_days [ SWAP [] 1.0 reducer.percentile ] REDUCE { 'percentile' '0.10' } RELABEL
] FLATTEN
//
//
//
//[ SWAP [ '.dayofweek' ] reducer.mean.exclude-nulls ] REDUCE
//
//'mean by day' RENAME
// [ SWAP bucketizer.mean 0 20 m 0 ] BUCKETIZE 0 GET
//
// 1 d 'split' TIMEMODULO
%>
}
// Stat Thursday
{
'title' 'Stat Thursday'
'type' 'line'
'w' 12
'h' 2
'macro' <%
// @preview gts
// ## Code des compteurs
//
// - BARDONNEX (AR): CH:0200.xx xx=[01-06]
// - PLAN-LES-OUAT. (AR): CH:0224.xx xx=[01-04]
// - PONT DU RHONE (AR) CH:0272.xx [01-04]
// - COLOVREX-AEROPORT (AR) CH:0069 [01-04]
// - COLOVREX-LAC (AR) CH:0068 [01-04]
#############################################
## Fetch data
{
'token' "readToken"
'class' "~trafic.traffic-speed"
'labels' { "site_id" "~CH:0224.0[12]" }
'start' "2025-02-01T00:00:00.000Z"
'end' NOW // "2025-03-11T22:00:00.000Z"
} FETCH
'Europe/Paris' @senx/cal/bydayofweek
# Cut the data in 1 day slices
1 d 1 'split' TIMESPLIT
# As TIMESPLIT create an array of array grouped by day, we need to flatten it
FLATTEN
'list_of_days' STORE
#############################################
## Filter data
<%
SAVE 'context' STORE # Keep the stack but save all stored value linke $list_of_days
# Don't care about saturday and sunday .dayofweek < 6
4 == # Just keep days where .dayofweek < 6 or just one day : 1 == for monday, 2 == for tuesday ...
$context RESTORE
%> 'accept_day' STORE
$list_of_days
<%
LABELS '.dayofweek' GET TOLONG
@accept_day
%>
FILTERBY
#############################################
## All in same time window
1 d 'split' TIMEMODULO
FLATTEN
'list_of_days' STORE
#############################################
## Improve labels to understand a bit more
<%
SAVE 'context' STORE # Keep the stack but save all stored value linke $list_of_days
'gts' STORE
# Below, get the $date variable by processing split lable
$gts
LABELS 'split' GET TOLONG # Get the quotient of the modulo operation
1 d * # Map the quotient to ts
ISO8601 # Convert to ISO8601
0 10 SUBSTRING # keep the date only
'date' STORE
# Add the date to the labels
$gts { 'date' $date } RELABEL
$context RESTORE
%> 'give_iso_day_as_label' STORE
$list_of_days
<%
DROP // drop the index
@give_iso_day_as_label
%> LMAP
[ 'date' ] METASORT
'list_of_days' STORE
#############################################
## Show 1,25,50,75,99 percentiles
$list_of_days
[ SWAP bucketizer.mean 0 20 m 0 ] BUCKETIZE
'list_of_days' STORE
[
$list_of_days [ SWAP [] 99.0 reducer.percentile ] REDUCE { 'percentile' '0.99' } RELABEL
$list_of_days [ SWAP [] 75.0 reducer.percentile ] REDUCE { 'percentile' '0.75' } RELABEL
$list_of_days [ SWAP [] 50.0 reducer.percentile ] REDUCE { 'percentile' '0.50' } RELABEL
$list_of_days [ SWAP [] 25.0 reducer.percentile ] REDUCE { 'percentile' '0.25' } RELABEL
$list_of_days [ SWAP [] 1.0 reducer.percentile ] REDUCE { 'percentile' '0.10' } RELABEL
] FLATTEN
//
//
//
//[ SWAP [ '.dayofweek' ] reducer.mean.exclude-nulls ] REDUCE
//
//'mean by day' RENAME
// [ SWAP bucketizer.mean 0 20 m 0 ] BUCKETIZE 0 GET
//
// 1 d 'split' TIMEMODULO
%>
}
// Stat Friday
{
'title' 'Stat Friday'
'type' 'line'
'w' 12
'h' 2
'macro' <%
// @preview gts
// ## Code des compteurs
//
// - BARDONNEX (AR): CH:0200.xx xx=[01-06]
// - PLAN-LES-OUAT. (AR): CH:0224.xx xx=[01-04]
// - PONT DU RHONE (AR) CH:0272.xx [01-04]
// - COLOVREX-AEROPORT (AR) CH:0069 [01-04]
// - COLOVREX-LAC (AR) CH:0068 [01-04]
#############################################
## Fetch data
{
'token' "readToken"
'class' "~trafic.traffic-speed"
'labels' { "site_id" "~CH:0224.0[12]" }
'start' "2025-02-01T00:00:00.000Z"
'end' NOW // "2025-03-11T22:00:00.000Z"
} FETCH
'Europe/Paris' @senx/cal/bydayofweek
# Cut the data in 1 day slices
1 d 1 'split' TIMESPLIT
# As TIMESPLIT create an array of array grouped by day, we need to flatten it
FLATTEN
'list_of_days' STORE
#############################################
## Filter data
<%
SAVE 'context' STORE # Keep the stack but save all stored value linke $list_of_days
# Don't care about saturday and sunday .dayofweek < 6
5 == # Just keep days where .dayofweek < 6 or just one day : 1 == for monday, 2 == for tuesday ...
$context RESTORE
%> 'accept_day' STORE
$list_of_days
<%
LABELS '.dayofweek' GET TOLONG
@accept_day
%>
FILTERBY
#############################################
## All in same time window
1 d 'split' TIMEMODULO
FLATTEN
'list_of_days' STORE
#############################################
## Improve labels to understand a bit more
<%
SAVE 'context' STORE # Keep the stack but save all stored value linke $list_of_days
'gts' STORE
# Below, get the $date variable by processing split lable
$gts
LABELS 'split' GET TOLONG # Get the quotient of the modulo operation
1 d * # Map the quotient to ts
ISO8601 # Convert to ISO8601
0 10 SUBSTRING # keep the date only
'date' STORE
# Add the date to the labels
$gts { 'date' $date } RELABEL
$context RESTORE
%> 'give_iso_day_as_label' STORE
$list_of_days
<%
DROP // drop the index
@give_iso_day_as_label
%> LMAP
[ 'date' ] METASORT
'list_of_days' STORE
#############################################
## Show 1,25,50,75,99 percentiles
$list_of_days
[ SWAP bucketizer.mean 0 20 m 0 ] BUCKETIZE
'list_of_days' STORE
[
$list_of_days [ SWAP [] 99.0 reducer.percentile ] REDUCE { 'percentile' '0.99' } RELABEL
$list_of_days [ SWAP [] 75.0 reducer.percentile ] REDUCE { 'percentile' '0.75' } RELABEL
$list_of_days [ SWAP [] 50.0 reducer.percentile ] REDUCE { 'percentile' '0.50' } RELABEL
$list_of_days [ SWAP [] 25.0 reducer.percentile ] REDUCE { 'percentile' '0.25' } RELABEL
$list_of_days [ SWAP [] 1.0 reducer.percentile ] REDUCE { 'percentile' '0.10' } RELABEL
] FLATTEN
//
//
//
//[ SWAP [ '.dayofweek' ] reducer.mean.exclude-nulls ] REDUCE
//
//'mean by day' RENAME
// [ SWAP bucketizer.mean 0 20 m 0 ] BUCKETIZE 0 GET
//
// 1 d 'split' TIMEMODULO
%>
}
// Stat Saturday
{
'title' 'Stat Saturday'
'type' 'line'
'w' 12
'h' 2
'macro' <%
// @preview gts
// ## Code des compteurs
//
// - BARDONNEX (AR): CH:0200.xx xx=[01-06]
// - PLAN-LES-OUAT. (AR): CH:0224.xx xx=[01-04]
// - PONT DU RHONE (AR) CH:0272.xx [01-04]
// - COLOVREX-AEROPORT (AR) CH:0069 [01-04]
// - COLOVREX-LAC (AR) CH:0068 [01-04]
#############################################
## Fetch data
{
'token' "readToken"
'class' "~trafic.traffic-speed"
'labels' { "site_id" "~CH:0224.0[12]" }
'start' "2025-02-01T00:00:00.000Z"
'end' NOW // "2025-03-11T22:00:00.000Z"
} FETCH
'Europe/Paris' @senx/cal/bydayofweek
# Cut the data in 1 day slices
1 d 1 'split' TIMESPLIT
# As TIMESPLIT create an array of array grouped by day, we need to flatten it
FLATTEN
'list_of_days' STORE
#############################################
## Filter data
<%
SAVE 'context' STORE # Keep the stack but save all stored value linke $list_of_days
# Don't care about saturday and sunday .dayofweek < 6
6 == # Just keep days where .dayofweek < 6 or just one day : 1 == for monday, 2 == for tuesday ...
$context RESTORE
%> 'accept_day' STORE
$list_of_days
<%
LABELS '.dayofweek' GET TOLONG
@accept_day
%>
FILTERBY
#############################################
## All in same time window
1 d 'split' TIMEMODULO
FLATTEN
'list_of_days' STORE
#############################################
## Improve labels to understand a bit more
<%
SAVE 'context' STORE # Keep the stack but save all stored value linke $list_of_days
'gts' STORE
# Below, get the $date variable by processing split lable
$gts
LABELS 'split' GET TOLONG # Get the quotient of the modulo operation
1 d * # Map the quotient to ts
ISO8601 # Convert to ISO8601
0 10 SUBSTRING # keep the date only
'date' STORE
# Add the date to the labels
$gts { 'date' $date } RELABEL
$context RESTORE
%> 'give_iso_day_as_label' STORE
$list_of_days
<%
DROP // drop the index
@give_iso_day_as_label
%> LMAP
[ 'date' ] METASORT
'list_of_days' STORE
#############################################
## Show 1,25,50,75,99 percentiles
$list_of_days
[ SWAP bucketizer.mean 0 20 m 0 ] BUCKETIZE
'list_of_days' STORE
[
$list_of_days [ SWAP [] 99.0 reducer.percentile ] REDUCE { 'percentile' '0.99' } RELABEL
$list_of_days [ SWAP [] 75.0 reducer.percentile ] REDUCE { 'percentile' '0.75' } RELABEL
$list_of_days [ SWAP [] 50.0 reducer.percentile ] REDUCE { 'percentile' '0.50' } RELABEL
$list_of_days [ SWAP [] 25.0 reducer.percentile ] REDUCE { 'percentile' '0.25' } RELABEL
$list_of_days [ SWAP [] 1.0 reducer.percentile ] REDUCE { 'percentile' '0.10' } RELABEL
] FLATTEN
//
//
//
//[ SWAP [ '.dayofweek' ] reducer.mean.exclude-nulls ] REDUCE
//
//'mean by day' RENAME
// [ SWAP bucketizer.mean 0 20 m 0 ] BUCKETIZE 0 GET
//
// 1 d 'split' TIMEMODULO
%>
}
// Stat Sunday
{
'title' 'Stat Sunday'
'type' 'line'
'w' 12
'h' 2
'macro' <%
// @preview gts
// ## Code des compteurs
//
// - BARDONNEX (AR): CH:0200.xx xx=[01-06]
// - PLAN-LES-OUAT. (AR): CH:0224.xx xx=[01-04]
// - PONT DU RHONE (AR) CH:0272.xx [01-04]
// - COLOVREX-AEROPORT (AR) CH:0069 [01-04]
// - COLOVREX-LAC (AR) CH:0068 [01-04]
#############################################
## Fetch data
{
'token' "readToken"
'class' "~trafic.traffic-speed"
'labels' { "site_id" "~CH:0224.0[12]" }
'start' "2025-02-01T00:00:00.000Z"
'end' NOW // "2025-03-11T22:00:00.000Z"
} FETCH
'Europe/Paris' @senx/cal/bydayofweek
# Cut the data in 1 day slices
1 d 1 'split' TIMESPLIT
# As TIMESPLIT create an array of array grouped by day, we need to flatten it
FLATTEN
'list_of_days' STORE
#############################################
## Filter data
<%
SAVE 'context' STORE # Keep the stack but save all stored value linke $list_of_days
# Don't care about saturday and sunday .dayofweek < 6
7 == # Just keep days where .dayofweek < 6 or just one day : 1 == for monday, 2 == for tuesday ...
$context RESTORE
%> 'accept_day' STORE
$list_of_days
<%
LABELS '.dayofweek' GET TOLONG
@accept_day
%>
FILTERBY
#############################################
## All in same time window
1 d 'split' TIMEMODULO
FLATTEN
'list_of_days' STORE
#############################################
## Improve labels to understand a bit more
<%
SAVE 'context' STORE # Keep the stack but save all stored value linke $list_of_days
'gts' STORE
# Below, get the $date variable by processing split lable
$gts
LABELS 'split' GET TOLONG # Get the quotient of the modulo operation
1 d * # Map the quotient to ts
ISO8601 # Convert to ISO8601
0 10 SUBSTRING # keep the date only
'date' STORE
# Add the date to the labels
$gts { 'date' $date } RELABEL
$context RESTORE
%> 'give_iso_day_as_label' STORE
$list_of_days
<%
DROP // drop the index
@give_iso_day_as_label
%> LMAP
[ 'date' ] METASORT
'list_of_days' STORE
#############################################
## Show 1,25,50,75,99 percentiles
$list_of_days
[ SWAP bucketizer.mean 0 20 m 0 ] BUCKETIZE
'list_of_days' STORE
[
$list_of_days [ SWAP [] 99.0 reducer.percentile ] REDUCE { 'percentile' '0.99' } RELABEL
$list_of_days [ SWAP [] 75.0 reducer.percentile ] REDUCE { 'percentile' '0.75' } RELABEL
$list_of_days [ SWAP [] 50.0 reducer.percentile ] REDUCE { 'percentile' '0.50' } RELABEL
$list_of_days [ SWAP [] 25.0 reducer.percentile ] REDUCE { 'percentile' '0.25' } RELABEL
$list_of_days [ SWAP [] 1.0 reducer.percentile ] REDUCE { 'percentile' '0.10' } RELABEL
] FLATTEN
//
//
//
//[ SWAP [ '.dayofweek' ] reducer.mean.exclude-nulls ] REDUCE
//
//'mean by day' RENAME
// [ SWAP bucketizer.mean 0 20 m 0 ] BUCKETIZE 0 GET
//
// 1 d 'split' TIMEMODULO
%>
}
]
}