Skip to content

Instantly share code, notes, and snippets.

@kylebrandt
Last active April 27, 2022 14:12
Show Gist options
  • Save kylebrandt/101d887bae96c041af8a219c9bd6ccd2 to your computer and use it in GitHub Desktop.
Save kylebrandt/101d887bae96c041af8a219c9bd6ccd2 to your computer and use it in GitHub Desktop.
Formats Examples As Table

Frame Examples - Time Series Kind

Basic Example

This demonstrates the same set of two time series in all formats to serve as an introduction.

Wide

Type - Time
Name - T
Labels - nil
Type - Number
Name - cpu
Labels - {"host": "a"}
Type - Number
Name - cpu
Labels - {"host": "b"}
2022-04-27 5:00 1 6
2022-04-27 6:00 4 8
2022-04-27 7:00 2 5
2022-04-27 8:00 3 9

Multi

Frame 0:

Type - Time
Name - T
Labels - nil
Type - Number
Name - cpu
Labels - {"host": "a"}
2022-04-27 5:00 1
2022-04-27 6:00 4
2022-04-27 7:00 2
2022-04-27 8:00 3

Frame 1:

Type - Time
Name - T
Labels - nil
Type - Number
Name - cpu
Labels - {"host": "b"}
2022-04-27 5:00 6
2022-04-27 6:00 8
2022-04-27 7:00 5
2022-04-27 8:00 9

Long

Type - Time
Name - T
Labels - nil
Type - String
Name - host
Labels - nil
Type - Number
Name - cpu
Labels - nil
2022-04-27 5:00 a 1
2022-04-27 5:00 b 6
2022-04-27 6:00 a 4
2022-04-27 6:00 b 8
2022-04-27 7:00 a 2
2022-04-27 7:00 b 5
2022-04-27 8:00 a 3
2022-04-27 8:00 b 9

Frame Examples - Time Series Kind (CSV Data)

Basic Example

This demonstrates the same set of two time series in all formats to serve as an introduction.

Wide

Type - Time<br />Name - T<br /> Labels - nil, Type - Number<br />Name - cpu<br /> Labels - {"host": "a"}, Type - Number<br />Name - cpu<br /> Labels - {"host": "b"}
2022-04-27 5:00,1,6
2022-04-27 6:00,4,8
2022-04-27 7:00,2,5
2022-04-27 8:00,3,9

Multi

Frame 0:

Type - Time<br />Name - T<br /> Labels - nil, Type - Number<br />Name - cpu<br /> Labels - {"host": "a"}
2022-04-27 5:00,1
2022-04-27 6:00,4
2022-04-27 7:00,2
2022-04-27 8:00,3

Frame 1:

Type - Time<br />Name - T<br /> Labels - nil, Type - Number<br />Name - cpu<br /> Labels - {"host": "b"}
2022-04-27 5:00,6
2022-04-27 6:00,8
2022-04-27 7:00,5
2022-04-27 8:00,9

Long

Type - Time<br />Name - T<br /> Labels - nil, Type - String<br />Name - host<br /> Labels - nil,  Type - Number<br />Name - cpu<br /> Labels - nil, 
2022-04-27 5:00,a,1
2022-04-27 5:00,b,6
2022-04-27 6:00,a,4
2022-04-27 6:00,b,8
2022-04-27 7:00,a,2
2022-04-27 7:00,b,5
2022-04-27 8:00,a,3
2022-04-27 8:00,b,9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment