| 1 | # SSV formatter |
| 2 | |
| 3 | The SSV formatter sums all dimensions in [results of database queries](/src/web/api/queries/README.md) |
| 4 | to a single value and returns a list of such values showing how it changes through time. |
| 5 | |
| 6 | It supports the following formats: |
| 7 | |
| 8 | | format | content type | description | |
| 9 | |:----:|:----------:|:----------| |
| 10 | | `ssv` | text/plain | a space separated list of values | |
| 11 | | `ssvcomma` | text/plain | a comma separated list of values | |
| 12 | | `array` | application/json | a JSON array | |
| 13 | |
| 14 | The SSV formatter respects the following API `&options=`: |
| 15 | |
| 16 | | option | supported | description | |
| 17 | | :----:|:-------:|:----------| |
| 18 | | `nonzero` | yes | to return only the dimensions that have at least a non-zero value | |
| 19 | | `flip` | yes | to return the numbers older to newer (the default is newer to older) | |
| 20 | | `percent` | yes | to replace all values with their percentage over the row total | |
| 21 | | `abs` | yes | to turn all values positive, before using them | |
| 22 | | `min2max` | yes | to return the delta from the minimum value to the maximum value (across dimensions) | |
| 23 | |
| 24 | ## Examples |
| 25 | |
| 26 | Get the average system CPU utilization of the last hour, in 6 values (one every 10 minutes): |
| 27 | |
| 28 | ```bash |
| 29 | # curl -Ss 'https://registry.my-netdata.io/api/v1/data?chart=system.cpu&format=ssv&after=-3600&points=6&group=average' |
| 30 | 1.741352 1.6800467 1.769411 1.6761112 1.629862 1.6807968 |
| 31 | ``` |
| 32 | |
| 33 | --- |
| 34 | |
| 35 | Get the total mysql bandwidth (in + out) for the last hour, in 6 values (one every 10 minutes): |
| 36 | |
| 37 | Netdata returns bandwidth in `kilobits`. |
| 38 | |
| 39 | ```bash |
| 40 | # curl -Ss 'https://registry.my-netdata.io/api/v1/data?chart=mysql_local.net&format=ssvcomma&after=-3600&points=6&group=sum&options=abs' |
| 41 | 72618.7936215,72618.778889,72618.788084,72618.9195918,72618.7760612,72618.6712421 |
| 42 | ``` |
| 43 | |
| 44 | --- |
| 45 | |
| 46 | Get the web server max connections for the last hour, in 12 values (one every 5 minutes) |
| 47 | in a JSON array: |
| 48 | |
| 49 | ```bash |
| 50 | # curl -Ss 'https://registry.my-netdata.io/api/v1/data?chart=nginx_local.connections&format=array&after=-3600&points=12&group=max' |
| 51 | [278,258,268,239,259,260,243,266,278,318,264,258] |
| 52 | ``` |
| 53 | |
| 54 |