{"id":21869718,"url":"https://github.com/cha87de/tsprofiler","last_synced_at":"2025-03-21T22:16:30.078Z","repository":{"id":57502260,"uuid":"154166821","full_name":"cha87de/tsprofiler","owner":"cha87de","description":"a profiler for time series data - from monitoring data stream to statistical profile","archived":false,"fork":false,"pushed_at":"2020-05-02T11:42:16.000Z","size":5647,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-26T16:44:43.096Z","etag":null,"topics":["monitoring","profiling-library","time-series"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cha87de.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-22T15:20:32.000Z","updated_at":"2020-05-02T11:42:19.000Z","dependencies_parsed_at":"2022-09-13T07:02:05.602Z","dependency_job_id":null,"html_url":"https://github.com/cha87de/tsprofiler","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cha87de%2Ftsprofiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cha87de%2Ftsprofiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cha87de%2Ftsprofiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cha87de%2Ftsprofiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cha87de","download_url":"https://codeload.github.com/cha87de/tsprofiler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244875045,"owners_count":20524591,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["monitoring","profiling-library","time-series"],"created_at":"2024-11-28T06:08:59.152Z","updated_at":"2025-03-21T22:16:30.053Z","avatar_url":"https://github.com/cha87de.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TSProfiler\n\n*a profiler for time series data* - **breaking changes may occur, since currently under development.**\n\n[![Build Status](https://travis-ci.org/cha87de/tsprofiler.svg?branch=master)](https://travis-ci.org/cha87de/tsprofiler)\n[![GoDoc](https://godoc.org/github.com/cha87de/tsprofiler/impl?status.svg)](https://godoc.org/github.com/cha87de/tsprofiler/impl)\n\n```\n+------------+       +------------+      +---------------+\n| TimeSeries | +---\u003e | TSProfiler | +--\u003e |  Statistical  |\n|    Data    |       |            |      |    Profile    |\n+------------+       +------------+      +---------------+\n```\n\n## Purpose\n\n*TSProfiler* provides a go implementation to convert time series stream data\nlike monitoring data online into statistical representative profiles. TSProfiler\nis integrated into the KVM monitoring tool\n[kvmtop](https://github.com/cha87de/kvmtop/tree/profiler) directly, or for\ndistributed setups into the [DisResc Monitoring\nLibrary](https://github.com/disresc/profiler).\n\nThe core concept bases on *Markov Chain*s to represent the probability of a\ndiscretized utilisation states, and a *Decision Tree* to handle periodic\nrecurrent Markov transition matrices (the period tree). Automatic phase\ndetection further identifies pattern changes.\n\n![TSProfiler Architecture](./docs/extendend-tsprofiler.svg \"TSProfiler Architecture\")\n\n\n## Usage Guide\n\n### Command line tool **csv2tsprofile**\n\nThe TSProfiler comes with a command line tool to read a CSV file and generate a\nTSProfile. [Get the most recent stable build from\nReleases.](https://github.com/cha87de/tsprofiler/releases)\n\n```\nUsage:\n  csv2tsprofile [OPTIONS]\n\nReads time series values from a CSV file and generates a tsprofile\n\nApplication Options:\n      --states=\n      --buffersize=\n      --history=\n      --filterstddevs=\n      --fixedbound\n      --fixedmin=              if fixedbound is set, set the min value (default: 0)\n      --fixedmax=              if fixedbound is set, set the max value (default: 100)\n      --periodsize=            comma separated list of ints, specifies descrete states per period\n      --phasechangelikeliness=\n      --phasechangehistory=\n      --output=                path to write profile to, stdout if '-' (default: -)\n      --out.history=           path to write last historic values to, stdout if '-', empty to disable\n      --out.phases=\n      --out.periods=\n      --out.states=\n\nHelp Options:\n  -h, --help                   Show this help message\n```\n\nExample: `csv2tsprofile --states 4 --history 1 --filterstddevs 4 --buffersize 6 --periodsize 2,24,48 path/to/tsinput.csv`\n\n### Command line tool **tspredictor**\n\nThe TSPredictor reads a TSProfile and the current position to provide simulation\nor likeliness calculations for future next states. The mode can be either 0\n(root tx), 1 (detected phases), or 2 (periods). Simulation or likeliness has to\nbe specified as the requested task.\n\n```\nUsage:\n  tspredictor [OPTIONS]\n\nReads a TSProfile from file and runs tasks on in (Simulate or Likeliness)\n\nApplication Options:\n      --steps=\n      --mode=\n      --periodDepth=\n  -p, --profile=\n  -h, --history=\n\nHelp Options:\n  -h, --help         Show this help message\n```\n\nExample (with csv2tsprofile):\n\n```\ncsv2tsprofile \\\n\t--fixedbound \\\n\t--fixedmin 0 \\\n\t--fixedmax 100 \\\n\t--states 10 \\\n\t--buffersize 1 \\\n\t--history 1 \\\n\t--periodsize 16,4 \\\n\t--phasechangelikeliness 0.50 \\\n\t--phasechangehistory 10 \\\n\t--out.history /tmp/history.json \\\n\t--output /tmp/profile.json \\\n\t--out.phases /tmp/out.phases.log \\\n\t--out.periods /tmp/out.periods.log \\\n\t--out.states /tmp/out.states.log \\\n\ttsinput.csv\n\ntspredictor \\\n\t--profile /tmp/profile.json \\\n\t--history /tmp/history.json \\\n\t--steps 4 \\\n\t--mode 0 \\\n\tsimulate\t\t\n```\n\n### Integrate into Go Code via TSProfiler API\n\nCreate a new TSProfiler:\n\n```go\ntsprofiler := profiler.NewProfiler(models.Settings{\n\t\tName:          \"profiler-hostX\",\n\t\tBufferSize:    10,\n\t\tStates:        4,\n\t\tFilterStdDevs: 4,\n\t\tHistory:       1,\n\t\tFixBound:      false,\n\t\tPeriodSize:    []int{60,720,1440},\n\t\t// ... many more settings\n\t\tOutputFreq:     time.Duration(20) * time.Second,\n\t\tOutputCallback: profileOutput,\n\t})\n\nfunc profileOutput(data models.TSProfile) {\n  // handle profiler output via OutputFreq\n}\n\n// get profile independently of OutputFreq\nprofile := profiler.Get()\n```\n\nProvide metric value to profiler:\n\n```go\nmetrics := make([]models.TSInputMetric, 0)\nmetrics = append(metrics, models.TSInputMetric{\n\t\tName:  \"CPU-Util\",\n\t\tValue: float64(utilValue),\n\t\tFixedMin: options.FixedMin, // optional, required for FixBound = true\n\t\tFixedMax: options.FixedMax, // optional, required for FixBound = true\n\t})\ntsinput := models.TSInput{\n\t\tMetrics: metrics,\n\t}\nprofiler.Put(tsinput)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcha87de%2Ftsprofiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcha87de%2Ftsprofiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcha87de%2Ftsprofiler/lists"}