{"id":27370148,"url":"https://github.com/datastax-archive/workshop-nosqlbench","last_synced_at":"2026-04-27T11:31:56.532Z","repository":{"id":41354933,"uuid":"421020120","full_name":"datastaxdevs/workshop-nosqlbench","owner":"datastaxdevs","description":"The goal of this workshop is to get you familiar with the powerful and versatile tool NoSQLBench. With that, you can perform industry-grade, robust benchmarks aimed at several (distributed) target systems, especially NoSQL databases.","archived":false,"fork":false,"pushed_at":"2023-05-22T12:03:40.000Z","size":9319,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-14T11:09:07.902Z","etag":null,"topics":["cassandra","nosql","nosqlbench","performance","test"],"latest_commit_sha":null,"homepage":"","language":"Python","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/datastaxdevs.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":"2021-10-25T12:45:41.000Z","updated_at":"2023-07-05T07:24:06.000Z","dependencies_parsed_at":"2023-02-12T01:46:35.014Z","dependency_job_id":null,"html_url":"https://github.com/datastaxdevs/workshop-nosqlbench","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datastaxdevs%2Fworkshop-nosqlbench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datastaxdevs%2Fworkshop-nosqlbench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datastaxdevs%2Fworkshop-nosqlbench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datastaxdevs%2Fworkshop-nosqlbench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datastaxdevs","download_url":"https://codeload.github.com/datastaxdevs/workshop-nosqlbench/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248688190,"owners_count":21145762,"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":["cassandra","nosql","nosqlbench","performance","test"],"created_at":"2025-04-13T08:48:06.948Z","updated_at":"2026-04-27T11:31:56.486Z","avatar_url":"https://github.com/datastaxdevs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Benchmark your Astra DB with NoSQLBench\n\n[![Gitpod hands-on](https://img.shields.io/badge/Gitpod-hands--on-blue?logo=gitpod)](https://gitpod.io/#https://github.com/datastaxdevs/workshop-nosqlbench)\n[![License Apache2](https://img.shields.io/hexpm/l/plug.svg)](http://www.apache.org/licenses/LICENSE-2.0)\n[![Discord](https://img.shields.io/discord/685554030159593522)](https://discord.com/widget?id=685554030159593522\u0026theme=dark)\n\n\u003cimg src=\"images/nosqlbench_banner.png?raw=true\" /\u003e\n\nTime: *2 hours*. Difficulty: *Intermediate*. [Start Building!](#create-your-astra-db-instance)\n\nThe goal of this workshop is to get you familiar with the powerful and versatile\ntool **[`NoSQLBench`](https://docs.nosqlbench.io/)**. With that, you can perform\n**industry-grade, robust benchmarks\naimed at several (distributed) target systems, especially NoSQL databases**.\n\nToday you'll be benchmarking Astra DB, a database-as-a-service built on top of\nApache Cassandra. Along the way, you will learn the basics of NoSQLBench.\n\nIn this repository you will find all material and references you need:\n\n- [NoSQLBench Discord](https://discord.gg/dBHRakusMN)\n- [NoSQLBench homepage](https://docs.nosqlbench.io/)\n- [Exercises](#create-your-astra-db-instance)\n- [Step-by-step guide](#before-you-start)\n- [DataStaxDevs Discord server](https://dtsx.io/discord) to keep in touch with us\n- [Our Q\u0026A forum](https://community.datastax.com/) (think StackOverflow for Cassandra and all things DataStax)\n- [Slide deck](slides/datastaxdevs-workshop-benchmarking-nosqlbench.pdf)\n\u003c!-- - [Workshop video](#) --\u003e\n\n#### Table of Contents\n\n1. [Before you start](#before-you-start)\n2. [Create your Astra DB instance](#create-your-astra-db-instance)\n3. [Launch Gitpod and setup NoSQLBench](#launch-gitpod-and-setup-nosqlbench)\n4. [Run benchmarks](#run-benchmarks)\n5. [Workloads](#workloads)\n6. [Homework assignment](#homework-assignment)\n\n\n\n## Before you start\n\n\u003cimg src=\"images/attention.png?raw=true\" width=\"80\" align=\"left\" /\u003e\n\n\u003e **Heads up**: these instructions are available in two forms:\n\u003e a short and to-the-point one (_this one_),\n\u003e with just the useful commands if you are watching us live; and\n\u003e a [longer one](extended_README.md),\n\u003e with lots of explanations and details, designed for those who follow this workshop\n\u003e at their own pace. Please choose what best suits you!\n\n\n\n### FAQ\n\n- What are the prerequisites?\n\n\u003e This workshop is aimed at data architects, solution architects, developers, or anybody who\n\u003e wants to get serious about measuring the performance of their data-intensive system.\n\u003e You should know what a (distributed) database is, and have a general understanding of the\n\u003e challenges of communicating over a network.\n\n- Do I need to install a database or anything on my machine?\n\n\u003e No, no need to install anything. You will do everything in the browser.\n\u003e (That being said, the knowledge you gain today will probably be best put to\n\u003e use once you install NoSQLBench on some client machine to run tests.)\n\n\u003e You can also choose to work on your machine instead of using Gitpod: there's\n\u003e no problem with that, just a few setup and operational changes to keep\n\u003e in mind. We will not provide live support in this case, though,\n\u003e assuming you know what you are doing.\n\n- Is there anything to pay?\n\n\u003e **No.** All materials, services and software used in this workshop is _free_.\n\n- Do you cover NoSQLBench 4 or 5?\n\n\u003e Ah, I see you are a connoisseur. We focus on the newly-release **NoSQLBench 5**,\n\u003e but we provide tips and remarks aimed at those still using nb4.\n\n### Homework\n\n\u003cimg src=\"images/nosqlbench_badge_artwork.png?raw=true\" width=\"200\" align=\"right\" /\u003e\n\nTo complete the workshop and get a verified \"NoSQLBench\" badge,\nfollow these instructions:\n\n1. Do the hands-on practice, either during the workshop or by following the instructions in this README;\n2. (optional) Complete the \"Lab\" assignment as detailed [here](homework/homework.md);\n3. Fill the submission form [here](https://dtsx.io/homework-nosqlbench). Answer the theory questions and (optionally) provide a _screenshot_ of the completed \"Lab\" part;\n4. give us a few days to process your submission: you should receive your well-earned badge in your email inbox!\n\n\n\n## Create your Astra DB instance\n\nFirst you must create a database: an instance of Astra DB, which\nyou will then benchmark with NoSQLBench.\n\n\u003e Don't worry, you will create\n\u003e it within the \"Free Tier\", which offers quite a generous free\n\u003e allowance in terms of monthly I/O (about 40M operations per month)\n\u003e and storage (80 GB).\n\n\u003ca href=\"https://astra.datastax.com\"\u003e\u003cimg src=\"images/create_astra_db.png?raw=true\" /\u003e\u003c/a\u003e\n\nYou need to:\n\n- create an Astra DB instance [as explained here](https://awesome-astra.github.io/docs/pages/astra/create-instance/#c-procedure), with **database name** = `workshops` and **keyspace name** = `nbkeyspace`;\n- _(this will happen automatically with the previous one)_ generate and retrieve a DB Token [as explained here](https://awesome-astra.github.io/docs/pages/astra/create-token/#c-procedure). **Important**: use the role _\"DB Administrator\"_ if manually creating the token.\n- generate and download a Secure Connect Bundle [as explained here](https://awesome-astra.github.io/docs/pages/astra/download-scb/#c-procedure);\n\nMoreover, keep the Astra DB dashboard open: it will be useful later. In particular, locate the\nHealth tab and the CQL Console.\n\n\n\n## Launch Gitpod and setup NoSQLBench\n\n**Ctrl-click on the Gitpod button below** to spawn your very own environment + IDE:\n\n[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/datastaxdevs/workshop-nosqlbench)\n\nIn a few minutes, a full IDE will be ready in your browser, with a file\nexplorer on the left, a file editor on the top, and a console (`bash`) below it.\n\n\n\n### Install NoSQLBench\n\nTo download NoSQLBench, type or paste this command in your Gitpod console:\n```bash\ncurl -L -O https://github.com/nosqlbench/nosqlbench/releases/latest/download/nb5\n```\n\nthen make it executable and move it to a better place:\n```bash\nchmod +x nb5\nsudo mv nb5 /usr/local/bin/\n```\n\nOk, now check that the program starts: invoking\n```bash\nnb5 --version\n```\nshould output the program version (something like `5.17.3` or higher).\n\n\n#### Version used\n\nThis workshop is built for the newly-released NoSQLBench 5.\n\n\n### Upload the Secure Connect Bundle to Gitpod\n\n\nLocate, with the file explorer on your computer, the bundle file that\nyou downloaded earlier (it should be called\n`secure-connect-workshops.zip`)\nand simply **drag-and-drop** it to the file navigator panel\n(\"Explorer\") on the left of the Gitpod view.\n\n\u003cdetails\u003e\u003csummary\u003eShow me\u003c/summary\u003e\n    \u003cimg src=\"https://github.com/datastaxdevs/workshop-nosqlbench/raw/main/images/gitpod_uploading_bundle_1_annotated.png?raw=true\" /\u003e\n\u003c/details\u003e\n\nOnce you drop it you will see it listed in the file explorer itself.\nAs a check, you can issue the command\n```bash\nls /workspace/workshop-nosqlbench/secure*zip -lh\n```\n\nso that you get the _absolute path to your bundle file_ (and also verify that it is\nthe correct size, about 12-13 KB).\n\n\u003cdetails\u003e\u003csummary\u003eShow me\u003c/summary\u003e\n    \u003cimg src=\"https://github.com/datastaxdevs/workshop-nosqlbench/raw/main/images/gitpod_uploading_bundle_2b_annotated.png?raw=true\" /\u003e\n\u003c/details\u003e\n\n\n### Configure the Astra DB parameters\n\n\nCopy the provided template file to a new one and open it in the Gitpod\nfile editor:\n```bash\ncp .env.sample .env\ngp open .env\n# (you can also simply locate the file\n#  in the Explorer and click on it)\n```\n\nInsert the \"Client ID\" and \"Client Secret\" of the DB Token you created earlier\nand, if necessary, adjust the other variables.\n\n\u003cdetails\u003e\u003csummary\u003eShow me what the .env file would look like\u003c/summary\u003e\n    \u003cimg src=\"https://github.com/datastaxdevs/workshop-nosqlbench/raw/main/images/dotenv2.png?raw=true\" /\u003e\n\u003c/details\u003e\n\nNow, source this file to make the definitions therein available to this shell:\n```bash\n. .env\n```\n\nTo check that the file has been sourced, you can try with:\n```bash\necho ${ASTRA_DB_KEYSPACE_NAME}\n```\n\nand make sure the output is not an empty line.\n\n(Note that you will have to source the file in any new shell you plan to use).\n\n\n\n## Run benchmarks\n\nEverything is set to start running the tool.\n\n\n### A short dry run\n\n\nTry launching this very short \"dry-run benchmark\", that instead of actually\nreaching the database simply prints a series of CQL statements to the console\n(as specified by the `driver=stdout` parameter):\n\n```bash\nnb5 cql-keyvalue2 astra                 \\\n    driver=stdout                       \\\n    rampup-cycles=10                    \\\n    main-cycles=10                      \\\n    keyspace=${ASTRA_DB_KEYSPACE_NAME}\n```\n\nYou will see 21 (fully-formed, valid CQL) statements being printed:\none `CREATE TABLE`, then ten `INSERT`s\nand then another ten between `SELECT`s and further `INSERT`s.\n\n\u003e **Note**: we will use workload `cql-keyvalue2` throughout. This is functionally\n\u003e identical to the `cql-keyvalue` workload but is expressed in the newer syntax for\n\u003e `yaml` workloads, which comes handy when later dissecting its content.\n\u003e If you are working with NoSQLBench 4, remember to drop the trailing `2`\n\u003e from the workload name in the following!\n\n\nNow re-launch the above dry run and look for differences in the output:\n\n```bash\nnb5 cql-keyvalue2 astra                 \\\n    driver=stdout                       \\\n    rampup-cycles=10                    \\\n    main-cycles=10                      \\\n    keyspace=${ASTRA_DB_KEYSPACE_NAME}\n```\n\nis the output identical to the previous run down to the actual \"random\" values?\n\nYou can also peek at the `logs` directory now: it is created automatically and\npopulated with some information from the benchmark at each execution of `nb`.\n\n\n### Benchmark your Astra DB\n\nIt is now time to start hitting the database!\n\nThis time you will run with `driver=cql` to actually reach the database:\nfor that to work, you will provide all connection parameters set up earlier.\n\n\nThe next run will ask NoSQLBench to perform a substantial amount of operations,\nin order to collect enough statistical support for the results.\n\n\nHere is the full command to launch:\n\n```bash\nnb5 cql-keyvalue2                                                         \\\n    astra                                                                 \\\n    username=${ASTRA_DB_CLIENT_ID}                                        \\\n    password=${ASTRA_DB_CLIENT_SECRET}                                    \\\n    secureconnectbundle=${ASTRA_DB_BUNDLE_PATH}                           \\\n    keyspace=${ASTRA_DB_KEYSPACE_NAME}                                    \\\n    cyclerate=50                                                          \\\n    driver=cql                                                            \\\n    main-cycles=9000                                                      \\\n    rampup-cycles=9000                                                    \\\n    errors='OverloadedException:warn'                                     \\\n    --progress console:5s                                                 \\\n    --log-histograms 'histogram_hdr_data.log:.*.main.result.*:20s'        \\\n    --log-histostats 'hdrstats.log:.*.main.result.*:20s'\n```\n\n\u003cdetails\u003e\u003csummary\u003eShow me the command breakdown\u003c/summary\u003e\n\nNote that some of the parameters (e.g. `keyspace`) are workload-specific.\n\n| command                   | meaning                                      |\n|---------------------------|----------------------------------------------|\n| `cql-keyvalue2`           | workload\n| `astra`                   | scenario\n| `username`                | authentication\n| `password`                | authentication\n| `secureconnectbundle`     | Astra DB connection parameters\n| `keyspace`                | target keyspace\n| `cyclerate`               | rate-limiting (cycles per second)\n| `driver=cql`              | driver to use (CQL, for AstraDB/Cassandra)\n| `main-cycles`             | how many operations in the \"main\" phase\n| `rampup-cycles`           | how many operations in the \"rampup\" phase\n| `errors`                  | behaviour if errors occur during benchmarking\n| `--progress console`      | frequency of console prints\n| `--log-histograms`        | write data to HDR file (see later)\n| `--log-histostats`        | write some basic stats to a file (see later)\n\nThis way of invoking `nb`, the [\"named scenario\"](https://docs.nosqlbench.io/docs/workloads_101/11-named-scenarios/)\nway, is not the only one: it is also possible to have a finer-grained control over what activities should\nrun with a full-fledged [CLI scripting](https://docs.nosqlbench.io/docs/reference/cli-scripting/) syntax.\n\n\u003e**Note**: the syntax of the `errors` parameter has been improved in NoSQLBench 5\n\u003e to allow for a [finer control](https://docs.nosqlbench.io/docs/reference/error-handlers/) (with multiple directives,\n\u003e such as `errors='NoNodeAvailable.*:ignore;InvalidQueryException.*:counter;OverloadedException:warn'`).\n\u003e On version 4 you should revert to a simpler parameter,\n\u003e such as `errors=count`, instead of the above.\n\n\u003c/details\u003e\n\n\nThe benchmark should last about ten minutes, with the progress being\nprinted on the console as it proceeds.\n\n\nWhile this runs, have a look around.\n\n#### Database contents\n\nNow it's time to find out _what is actually being written to the database_.\n\nChoose your database in the Astra main dashboard and click on it;\nnext, go to the \"CQL Console\" tab in the main panel. In a few seconds the\nconsole will open in your browser, already connected to your database and\nwaiting for your input.\n\n\u003cdetails\u003e\u003csummary\u003eShow me how to get to the CQL Console in Astra\u003c/summary\u003e\n    \u003cimg src=\"https://github.com/datastaxdevs/workshop-nosqlbench/raw/main/images/astra_get_to_cql_console.gif?raw=true\" /\u003e\n\u003c/details\u003e\n\n\nStart by telling the console that you will be using the `nbkeyspace` keyspace:\n```\nUSE nbkeyspace;\n```\n\nCheck what tables have been created by NoSQLBench in this keyspace:\n```\nDESC TABLES;\n```\n\nYou should see table `keyvalue` listed as the sole output.\nLook at a a few lines from this table:\n```\nSELECT * FROM keyvalue LIMIT 20;\n```\n\n\u003cdetails\u003e\u003csummary\u003eShow me what the output looks like\u003c/summary\u003e\n    \u003cimg src=\"https://github.com/datastaxdevs/workshop-nosqlbench/raw/main/images/select_cql.png?raw=true\" /\u003e\n\u003c/details\u003e\n\nOk, mystery solved. It looks like the table contains simple key-value pairs,\nwith two columns seemingly of numeric type. Check with:\n```\nDESC TABLE keyvalue;\n```\n\nOh, looks like both the key and the value columns are of type `TEXT`:\ngood for adapting this ready-made benchmark to other key/value stores.\n\n\u003cdetails\u003e\u003csummary\u003eShow me what the output looks like\u003c/summary\u003e\n    \u003cimg src=\"https://github.com/datastaxdevs/workshop-nosqlbench/raw/main/images/desctable_cql.png?raw=true\" /\u003e\n\u003c/details\u003e\n\n#### Database health\n\n\nLocate your database in the Astra main dashboard and click on it;\nnext, go to the \"Health\" tab in the main panel. You will see what essentially\nis a Grafana dashboard, with a handful of plots being displayed within the\ntab - all related to how the database is performing in terms of reads and writes.\n\n\u003cdetails\u003e\u003csummary\u003eShow me the Database Health tab in Astra UI\u003c/summary\u003e\n    \u003cimg src=\"https://github.com/datastaxdevs/workshop-nosqlbench/raw/main/images/astra_db_health2_annotated.png?raw=true\" /\u003e\n\u003c/details\u003e\n\nCheck the operations per second from the \"Requests Combined\" plot;\nthen have a look at the \"Write Latency\" and \"Read Latency\" plots\nand take note of some of the percentiles shown there.\n\n\u003cdetails\u003e\u003csummary\u003eShow me \"sample values\" one could read from the graph\u003c/summary\u003e\n\nBelow is a real-life example of the values that could result from a `cql-keyvalue2`\nbenchmark session in the _main_ phase:\n\n| Percentile  | Write Latency  | Read Latency   |\n|-------------|----------------|----------------|\n| P50         | 709     _µs_   |  935     _µs_  |\n| P75         | 831     _µs_   |    1.31  _ms_  |\n| P90         | 904     _µs_   |    1.53  _ms_  |\n| P95         |   1.04  _ms_   |    1.77  _ms_  |\n| P99         |   2.45  _ms_   |   15.6   _ms_  |\n\n\u003c/details\u003e\n\n\n#### Final summary in \"logs/\"\n\nWhen the benchmark has finished, open the latest `*.summary` file and look\nfor `cqlkeyvalue2_astra_main.result-success`.\n\nUnder that metric title, you will see something similar to:\n\n```\ncqlkeyvalue2_astra_main.result-success\n             count = 15000\n         mean rate = 50.00 calls/second\n     1-minute rate = 49.94 calls/second\n     5-minute rate = 50.29 calls/second\n    15-minute rate = 50.57 calls/second\n```\n\n\n#### Additional \"histostats\" datafile\n\nUse this script to generate a graph of the data collected as \"histostats\":\n\n```bash\n./hdr_tool/histostats_quick_plotter.py \\\n    hdrstats.log \\\n    -m cqlkeyvalue2_astra_main.result-success\n```\n\nand then open, in the Gitpod editor, the `hdrstats.png` image just created.\n\n\u003cdetails\u003e\u003csummary\u003eShow me the generated \"histostats\" plot\u003c/summary\u003e\n    \u003cimg src=\"https://github.com/datastaxdevs/workshop-nosqlbench/raw/main/images/histostats_plot3.png?raw=true\" width=\"360\" /\u003e\n\u003c/details\u003e\n\n\u003e The version of the plotter script included in this repo is for **educational purposes only**:\n\u003e for general use, please head to\n\u003e [the official release page](https://pypi.org/project/nb-hdr-plotter/).\n\nThe timings will be larger than those from the Astra health tab: indeed,\nthese are \"as seen on the client side\" and include more network hops.\n\n\n#### HDR extensive histogram data\n\nUse this script to generate plots from the detailed \"HDR histogram data\"\ngenerated during the benchmark:\n\n```bash\n./hdr_tool/hdr_tool.py \\\n    histogram_hdr_data.log \\\n    -b -c -s \\\n    -p SampleData \\\n    -m cqlkeyvalue2_astra_main.result-success\n```\n\n\n\u003cdetails\u003e\u003csummary\u003eShow me the plots generated by the HDR file\u003c/summary\u003e\n\n\u003cimg src=\"https://github.com/datastaxdevs/workshop-nosqlbench/raw/main/images/hdr_baseplot2.png?raw=true\" width=\"260\"/\u003e\n\n\u003cimg src=\"https://github.com/datastaxdevs/workshop-nosqlbench/raw/main/images/hdr_stabilityplot2.png?raw=true\" width=\"260\"/\u003e\n\n\u003cimg src=\"https://github.com/datastaxdevs/workshop-nosqlbench/raw/main/images/hdr_percentileplot2.png?raw=true\" width=\"260\"/\u003e\n\n\u003c/details\u003e\n\n\u003e The version of the plotter script included in this repo is for **educational purposes only**:\n\u003e for general use, please head to\n\u003e [the official release page](https://pypi.org/project/nb-hdr-plotter/).\n\nAgain, the timings are larger than those found on the Astra health tab\n(i.e. on server-side): these\nmeasurements are reported \"as seen by the testing client\".\n\n\n### Metrics, metrics, metrics\n\nLaunch a new benchmark, this time having NoSQLBench start a dockerized\nGrafana/Prometheus stack for metrics (it will take a few more seconds to start):\n\n```\nnb5 cql-keyvalue2                                                         \\\n    astra                                                                 \\\n    username=${ASTRA_DB_CLIENT_ID}                                        \\\n    password=${ASTRA_DB_CLIENT_SECRET}                                    \\\n    secureconnectbundle=${ASTRA_DB_BUNDLE_PATH}                           \\\n    keyspace=${ASTRA_DB_KEYSPACE_NAME}                                    \\\n    cyclerate=50                                                          \\\n    rampup-cycles=15000                                                   \\\n    main-cycles=15000                                                     \\\n    errors='OverloadedException:warn'                                     \\\n    --progress console:5s                                                 \\\n    --docker-metrics\n```\n\n\n\u003cdetails\u003e\u003csummary\u003eShow me the run with Docker metrics\u003c/summary\u003e\n    \u003cimg src=\"https://github.com/datastaxdevs/workshop-nosqlbench/raw/main/images/grafana_startingdockermetrics.png?raw=true\" /\u003e\n\u003c/details\u003e\n\n\n#### Grafana dashboard\n\nReach the Grafana container in a new tab, with an URL that has `3000-`\nin front of your Gitpod URL (e.g.\n`https://3000-datastaxdevs-workshopnos-[...].gitpod.io`).\n\nThe default credentials to log in to Grafana are ... `admin/admin`. Once you're\nin, don't bother to reset your password (click \"Skip\"). You'll get to the Grafana\nlanding page. Find the \"Dashboards\" icon in the leftmost menu bar and pick the\n\"Manage\" menu item: finally, click on the \"NB4 Dashboard\" item you should see\nlisted there. Congratulations, you are seeing the data coming from NoSQLBench.\n\n\u003cdetails\u003e\u003csummary\u003eShow me how to get to the Grafana plots\u003c/summary\u003e\n    \u003cimg src=\"https://github.com/datastaxdevs/workshop-nosqlbench/raw/main/images/grafana_dashboard.gif?raw=true\" /\u003e\n\u003c/details\u003e\n\n\u003e You may find it convenient to set the update frequency to something like 10\n\u003e seconds and the displayed time window to 5 minutes or so (upper-right controls).\n\nThe dashboard comprises several (interactive) plots, updated in real time.\n\n\u003cdetails\u003e\u003csummary\u003eShow me the dashboard contents\u003c/summary\u003e\n    \u003cimg src=\"https://github.com/datastaxdevs/workshop-nosqlbench/raw/main/images/grafana_plots.png?raw=true\" /\u003e\n\u003c/details\u003e\n\n\n#### A glance at Prometheus\n\nTo reach the Prometheus container, which handles the \"raw\" data behind Grafana,\nopen a modified URL (this time with `9090-`) in a new tab.\n\n\u003cdetails\u003e\u003csummary\u003eShow me the Prometheus UI\u003c/summary\u003e\n    \u003cimg src=\"https://github.com/datastaxdevs/workshop-nosqlbench/raw/main/images/prometheus2.gif?raw=true\" /\u003e\n\u003c/details\u003e\n\nClick on the \"world\" icon next to the \"Execute\" button in the search bar:\nin the dialog that appears you can look for specific metrics.\nTry to look for `result_success` and confirm, then click \"Execute\".\n\n\n\u003e **Tip:** switch to the \"Graph\" view for a more immediate visualization.\n\u003e The graphs display \"raw\" data, hence are in units of nanoseconds.\n\nTo make sense of the (heterogeneous) results, some filtering is in order --\nbut we are not entering too much into the details of Prometheus here.\n\nJust to pique your interest, try pasting these examples and click \"Execute\":\n\n```\n# filtering by metadata\n{__name__=\"result_success\", type=\"pctile\", alias=~\".*main.*\"}\n\n# aggregation\navg_over_time({__name__=\"result_success\", type=\"pctile\", alias=~\".*main.*\"}[10m])\n\n# another aggregation, + filtering\nmax_over_time({__name__=\"result_success\", type=\"pctile\", alias=~\".*main.*\"}[10m])\n```\n\n\n## Workloads\n\nThis part is about how workloads are defined.\n\n\u003e **Tip**: feel free to interrupt the previous benchmark, if it still runs,\n\u003e with Ctrl-C. You won't need it anymore.\n\n### Inspect \"cql-keyvalue\"\n\nAsk NoSQLBench to dump to a file the `yaml` defining the workload\nyou just ran:\n\n```bash\n    nb5 --copy cql-keyvalue2\n```\n\n_(you can also get a comprehensive list of all available workloads with\n`nb5 --list-workloads`, by the way, and a more fine-grained output with\n`nb5 --list-scenarios`.)_\n\nA file `cql-keyvalue2.yaml` is created in the working directory.\nYou can open it (clicking on it in the Gitpod explorer or by running\n`gp open cql-keyvalue2.yaml`).\n\nHave a look at the file and try to identify its structure and the various\nphases the benchmark is organized into.\n\nThere are profound differences in the way the same workload is expressed\nin the NoSQLBench 4 yaml file and the NoSQLBench 5 format.\n\n\u003cdetails\u003e\u003csummary\u003eShow me the differences\u003c/summary\u003e\n    \u003cimg src=\"https://github.com/datastaxdevs/workshop-nosqlbench/raw/main/images/cql-keyvalue-nb4-vs-nb5.png?raw=true\" /\u003e\n\u003c/details\u003e\n\n### Play with workloads\n\nA good way to understand workload construction is to start from simple ones.\n\nTo run the following examples please go to the appropriate subdirectory:\n```\ncd workloads\n```\n\n\n#### Example 1: talking about food\n\nRun the first example (and then look at the corresponding\n`simple-workload.yaml`) with:\n\n```\nnb5 run driver=stdout workload=simple-workload cycles=12\n```\n\nLook at how _bindings_ connect the sequence of operations to \"execute\"\n(in this case, simply print on screen) with the data to be used in\nthem.\n\n#### Example 2: animal meeting\n\nRun the second example, which is an example of structuring a workload\nin _phases_ (and then open `workload-with-phases.yaml`):\n\n```\nnb5 workload-with-phases default driver=stdout\n```\n\nNotable features of this workload are its multi-phase structure\n(a nearly universal feature of actual benchmarks), the use\nof the `ratio` parameter, and the usage of template parameters in the\ndefinition.\n\n\n\n## Homework assignment\n\nThe \"Lab\" part of the homework, which requires you to finalize\na workload `yaml` and make it work according to specifications,\nis detailed on [this page](homework/homework.md).\n\n**To submit your homework, please use [this form](https://dtsx.io/homework-nosqlbench).**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatastax-archive%2Fworkshop-nosqlbench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatastax-archive%2Fworkshop-nosqlbench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatastax-archive%2Fworkshop-nosqlbench/lists"}