{"id":22870979,"url":"https://github.com/percona-lab/metricbench","last_synced_at":"2025-10-29T18:23:04.157Z","repository":{"id":32654539,"uuid":"36241888","full_name":"Percona-Lab/MetricBench","owner":"Percona-Lab","description":null,"archived":false,"fork":false,"pushed_at":"2016-02-29T03:00:16.000Z","size":139,"stargazers_count":3,"open_issues_count":2,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-05T22:17:23.098Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Percona-Lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-25T16:30:23.000Z","updated_at":"2016-01-18T16:15:12.000Z","dependencies_parsed_at":"2022-08-27T16:51:56.399Z","dependency_job_id":null,"html_url":"https://github.com/Percona-Lab/MetricBench","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percona-Lab%2FMetricBench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percona-Lab%2FMetricBench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percona-Lab%2FMetricBench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percona-Lab%2FMetricBench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Percona-Lab","download_url":"https://codeload.github.com/Percona-Lab/MetricBench/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252584333,"owners_count":21771945,"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":[],"created_at":"2024-12-13T13:16:47.587Z","updated_at":"2025-10-29T18:23:04.107Z","avatar_url":"https://github.com/Percona-Lab.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MetricBench\n\nA windowed time-series benchmark focused on capturing metrics from devices, processing and purging expired data.\n\n## Building\n\n### Prerequisites:\n\n* C++ compiler supporting c++11 (g++-4.8+, Clang 3.3+)\n* CMake / make\n* MySQL C Client headers and library\n* MySQL Connector C++ headers and library (static)\n* Boost system, filesystem , program options and unit testing headers and libraries\n\n### Build:\n\n```bash\n$ cd src\n$ cmake .\n$ make\n```\n\n## Schema\nThe current implementation proposes a following schema\n\n```\nCREATE TABLE metricsN\n\tts timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',\n\tdevice_id int(10) unsigned NOT NULL,\n\tmetric_id int(10) unsigned NOT NULL,\n\tcnt int(10) unsigned NOT NULL,\n\tval double DEFAULT NULL,\n\tPRIMARY KEY (device_id, metric_id, ts),\n\tKEY k1 (device_id, ts, metric_id, val),\n\tKEY k2 (metric_id, ts, val),\n\tKEY k3 (ts, val)\n)\n```\n\nWhere we create N similar tables (N=10 by default), and `device_id` is in the range 1..5000 and `metric_id` is in range 1..50000, but only 500 metrics are inserted for a given (ts, device_id)\n\t\t    \n\t\t    \n\n## Running\n\n### Prerequisites: \n\n* MySQL server\n\n### Command line options:\n\n```\n  --help                            Help message\n  --mode arg                        Mode - run or prepare (load initial \n                                    dataset)\n  --url arg (=tcp://127.0.0.1:3306) Connection URL, e.g. tcp://[host[:port]], \n                                    unix://path/socket_file \n  --database arg (=test)            Connection Database (schema) to use\n  --user arg (=root)                Connection User for login\n  --password arg                    Connection Password for login\n  --hours arg (=10)                 Hours of traffic to simulate\n  --threads arg (=8)                Working threads\n  --tables arg (=10)\t\t    How many tables to populate\n  --engine arg (=InnoDB)            Set storage engine\n  --engine-extra arg                Extra storage engine options, e.g. \n                                    'ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8'\n```\n\n### Example usage:\n\nFirst the metric table needs to be created and loaded with initial data.\n\n```bash\n$ ./MetricBench --mode=prepare\n```\n\nSecondly, the run phase simulates windowed time-series operation on the database.\n\n```bash\n$ ./MetricBench --mode=run\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpercona-lab%2Fmetricbench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpercona-lab%2Fmetricbench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpercona-lab%2Fmetricbench/lists"}