Add TsFile (converted from ICOS-AI/live_cpu_utilization)
Browse files- README.md +91 -0
- live_cpu_utilization_g0.tsfile +0 -0
- live_cpu_utilization_g1.tsfile +0 -0
README.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- tsfile
|
| 5 |
+
- timeseries
|
| 6 |
+
- time-series
|
| 7 |
+
- format:tsfile
|
| 8 |
+
pretty_name: live_cpu_utilization (TsFile)
|
| 9 |
+
configs:
|
| 10 |
+
- config_name: default
|
| 11 |
+
data_files:
|
| 12 |
+
- split: train
|
| 13 |
+
path: live_cpu_utilization_g0.tsfile
|
| 14 |
+
- split: train
|
| 15 |
+
path: live_cpu_utilization_g1.tsfile
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
# live_cpu_utilization (TsFile)
|
| 19 |
+
|
| 20 |
+
Apache TsFile version of [`ICOS-AI/live_cpu_utilization`](https://huggingface.co/datasets/ICOS-AI/live_cpu_utilization).
|
| 21 |
+
|
| 22 |
+
## Overview
|
| 23 |
+
|
| 24 |
+
- **Tables:** 2 TsFile table(s), 2,488 rows in total.
|
| 25 |
+
- `live_cpu_utilization_g0`: 499 rows, 2023-06-28 16:26:24 鈫?2023-06-29 01:05:58 (UTC)
|
| 26 |
+
- `live_cpu_utilization_g1`: 1,989 rows, 2024-09-02 13:55:00 鈫?2024-09-09 11:35:00 (UTC)
|
| 27 |
+
|
| 28 |
+
## Schema (TsFile structure)
|
| 29 |
+
|
| 30 |
+
### `live_cpu_utilization_g0.tsfile`
|
| 31 |
+
|
| 32 |
+
- **Time** (INT64, milliseconds) 鈥?the source `Date` column.
|
| 33 |
+
- **TAG**: none 鈥?the table is stored as a single device.
|
| 34 |
+
- **FIELD** (10): `CPU_Core_0_Usage` (string), `CPU_Core_1_Usage` (double), `CPU_Core_2_Usage` (double), `CPU_Core_3_Usage` (double), `CPU_Core_4_Usage` (double), `CPU_Core_5_Usage` (double), `CPU_Core_6_Usage` (double), `CPU_Core_7_Usage` (double), `CPU_Usage_All_Cores` (double), `Memory_Usage` (double)
|
| 35 |
+
|
| 36 |
+
### `live_cpu_utilization_g1.tsfile`
|
| 37 |
+
|
| 38 |
+
- **Time** (INT64, milliseconds) 鈥?the source `timestamp` column.
|
| 39 |
+
- **TAG**: none 鈥?the table is stored as a single device.
|
| 40 |
+
- **FIELD** (2): `CPU` (double), `MEM` (double)
|
| 41 |
+
|
| 42 |
+
## Conversion notes
|
| 43 |
+
|
| 44 |
+
- One TsFile per source table (2 tables). Tables whose source carries several entities per file are stored as one device per entity.
|
| 45 |
+
- Time = the table's own clock column as INT64 milliseconds. The clock columns used here are `Date`, `timestamp`.
|
| 46 |
+
- No column is dropped. Rows that share a timestamp inside one device are ordered by a 1 ms step in stable source order, so calendar columns keep their exact day.
|
| 47 |
+
|
| 48 |
+
## Usage
|
| 49 |
+
|
| 50 |
+
> **Read this dataset with the Java SDK.** It is written with the `zstd` compressor. The Apache TsFile Java SDK reads every compressor, but the Python SDK (`pip install tsfile`) implements only `UNCOMPRESSED`, `SNAPPY`, `GZIP` and `LZ4`; opening this file with it yields no rows.
|
| 51 |
+
|
| 52 |
+
Read a converted file with the Apache TsFile Java SDK (`org.apache.tsfile:tsfile`):
|
| 53 |
+
|
| 54 |
+
```java
|
| 55 |
+
import org.apache.tsfile.file.metadata.IDeviceID;
|
| 56 |
+
import org.apache.tsfile.read.TsFileReader;
|
| 57 |
+
import org.apache.tsfile.read.TsFileSequenceReader;
|
| 58 |
+
import org.apache.tsfile.read.common.Path;
|
| 59 |
+
import org.apache.tsfile.read.expression.QueryExpression;
|
| 60 |
+
import org.apache.tsfile.read.query.dataset.QueryDataSet;
|
| 61 |
+
import org.apache.tsfile.write.schema.MeasurementSchema;
|
| 62 |
+
|
| 63 |
+
import java.util.ArrayList;
|
| 64 |
+
import java.util.List;
|
| 65 |
+
|
| 66 |
+
String path = "live_cpu_utilization_g0.tsfile";
|
| 67 |
+
try (TsFileSequenceReader sequenceReader = new TsFileSequenceReader(path);
|
| 68 |
+
TsFileReader reader = new TsFileReader(sequenceReader)) {
|
| 69 |
+
// Devices are enumerated as IDeviceID objects. Tables with TAG columns
|
| 70 |
+
// have multi-segment device ids that cannot be rebuilt from their string
|
| 71 |
+
// form, so always use getAllDevices() rather than getAllDeviceIds().
|
| 72 |
+
for (IDeviceID device : sequenceReader.getAllDevices()) {
|
| 73 |
+
List<Path> paths = new ArrayList<>();
|
| 74 |
+
for (MeasurementSchema schema : reader.getMeasurement(device)) {
|
| 75 |
+
String name = schema.getMeasurementName();
|
| 76 |
+
if (name != null && !name.isEmpty() && !name.equalsIgnoreCase("Time")) {
|
| 77 |
+
paths.add(new Path(device, name, true));
|
| 78 |
+
}
|
| 79 |
+
}
|
| 80 |
+
QueryDataSet dataSet = reader.query(QueryExpression.create(paths, null));
|
| 81 |
+
while (dataSet.hasNext()) {
|
| 82 |
+
System.out.println(dataSet.next());
|
| 83 |
+
}
|
| 84 |
+
}
|
| 85 |
+
}
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
## Source & license
|
| 89 |
+
|
| 90 |
+
- Original dataset: [`ICOS-AI/live_cpu_utilization`](https://huggingface.co/datasets/ICOS-AI/live_cpu_utilization)
|
| 91 |
+
- License: mit (as declared by the original dataset).
|
live_cpu_utilization_g0.tsfile
ADDED
|
Binary file (8.56 kB). View file
|
|
|
live_cpu_utilization_g1.tsfile
ADDED
|
Binary file (24.7 kB). View file
|
|
|