Skip to content

Commit 67dc396

Browse files
committed
update readme
1 parent ecf537e commit 67dc396

File tree

1 file changed

+74
-14
lines changed

1 file changed

+74
-14
lines changed

README.md

Lines changed: 74 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
*TSProfiler* provides a go implementation to convert time series stream data
1818
like monitoring data online into statistical representative profiles. TSProfiler
1919
is integrated into the KVM monitoring tool
20-
[kvmtop](https://github.com/cha87de/kvmtop/tree/profiler) directly, or for distributed setups into the [DisResc Monitoring Library](https://github.com/disresc/profiler).
20+
[kvmtop](https://github.com/cha87de/kvmtop/tree/profiler) directly, or for
21+
distributed setups into the [DisResc Monitoring
22+
Library](https://github.com/disresc/profiler).
2123

2224
The core concept bases on *Markov Chain*s to represent the probability of a
2325
discretized utilisation states, and a *Decision Tree* to handle periodic
@@ -31,34 +33,91 @@ detection further identifies pattern changes.
3133

3234
### Command line tool **csv2tsprofile**
3335

34-
The TSProfiler comes with a command line tool to read a CSV file and generate a TSProfile. [Get the most recent stable build from Releases.](https://github.com/cha87de/tsprofiler/releases)
35-
36-
Usage:
36+
The TSProfiler comes with a command line tool to read a CSV file and generate a
37+
TSProfile. [Get the most recent stable build from
38+
Releases.](https://github.com/cha87de/tsprofiler/releases)
3739

3840
```
3941
Usage:
4042
csv2tsprofile [OPTIONS]
43+
4144
Reads time series values from a CSV file and generates a tsprofile
45+
4246
Application Options:
4347
--states=
4448
--buffersize=
4549
--history=
4650
--filterstddevs=
4751
--fixedbound
48-
--fixedmin= if fixedbound is set, set the min value (default: 0)
49-
--fixedmax= if fixedbound is set, set the max value (default:
50-
100)
51-
--periodsize= comma separated list of ints, specifies descrete
52-
states per period (default: 60,720,1440)
53-
--periodchangeratio= accepted ratio [0,1] for changes, alert if above
54-
(default: 0.2)
55-
Help Options:
56-
-h, --help Show this help message
52+
--fixedmin= if fixedbound is set, set the min value (default: 0)
53+
--fixedmax= if fixedbound is set, set the max value (default: 100)
54+
--periodsize= comma separated list of ints, specifies descrete states per period
55+
--phasechangelikeliness=
56+
--phasechangehistory=
57+
--output= path to write profile to, stdout if '-' (default: -)
58+
--out.history= path to write last historic values to, stdout if '-', empty to disable
59+
--out.phases=
60+
--out.periods=
61+
--out.states=
5762
63+
Help Options:
64+
-h, --help Show this help message
5865
```
5966

6067
Example: `csv2tsprofile --states 4 --history 1 --filterstddevs 4 --buffersize 6 --periodsize 2,24,48 path/to/tsinput.csv`
6168

69+
### Command line tool **tspredictor**
70+
71+
The TSPredictor reads a TSProfile and the current position to provide simulation
72+
or likeliness calculations for future next states. The mode can be either 0
73+
(root tx), 1 (detected phases), or 2 (periods). Simulation or likeliness has to
74+
be specified as the requested task.
75+
76+
```
77+
Usage:
78+
tspredictor [OPTIONS]
79+
80+
Reads a TSProfile from file and runs tasks on in (Simulate or Likeliness)
81+
82+
Application Options:
83+
--steps=
84+
--mode=
85+
--periodDepth=
86+
-p, --profile=
87+
-h, --history=
88+
89+
Help Options:
90+
-h, --help Show this help message
91+
```
92+
93+
Example (with csv2tsprofile):
94+
95+
```
96+
csv2tsprofile \
97+
--fixedbound \
98+
--fixedmin 0 \
99+
--fixedmax 100 \
100+
--states 10 \
101+
--buffersize 1 \
102+
--history 1 \
103+
--periodsize 16,4 \
104+
--phasechangelikeliness 0.50 \
105+
--phasechangehistory 10 \
106+
--out.history /tmp/history.json \
107+
--output /tmp/profile.json \
108+
--out.phases /tmp/out.phases.log \
109+
--out.periods /tmp/out.periods.log \
110+
--out.states /tmp/out.states.log \
111+
tsinput.csv
112+
113+
tspredictor \
114+
--profile /tmp/profile.json \
115+
--history /tmp/history.json \
116+
--steps 4 \
117+
--mode 0 \
118+
simulate
119+
```
120+
62121
### Integrate into Go Code via TSProfiler API
63122

64123
Create a new TSProfiler:
@@ -72,8 +131,9 @@ tsprofiler := profiler.NewProfiler(models.Settings{
72131
History: 1,
73132
FixBound: false,
74133
PeriodSize: []int{60,720,1440},
134+
// ... many more settings
75135
OutputFreq: time.Duration(20) * time.Second,
76-
OutputCallback: profileOutput,
136+
OutputCallback: profileOutput,
77137
})
78138

79139
func profileOutput(data models.TSProfile) {

0 commit comments

Comments
 (0)