GithubHelp home page GithubHelp logo

cs-un / azurecosmosdb-requestunitstester Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ricardoniepel/azurecosmosdb-requestunitstester

0.0 1.0 0.0 19 KB

Sample console application for getting real data about how many request units are consumed

License: MIT License

C# 100.00%

azurecosmosdb-requestunitstester's Introduction

Azure Cosmos DB - Request Units Tester

Sample console application for getting real data about how many request units are consumed.

More details and documentation can be found at How to correctly calculate the Request Units in Azure Cosmos DB;

Getting started

  1. define documents to test
  2. define queries to test and their test data
  3. define index policies to test
  4. configure Azure Cosmos DB account endpoint and key
  5. RUN IT!
  6. Analyze the results

Define documents to test

Any number of JSON documents can be put into the folder 'scenarios'.

Each one needs be named like 'document.NAME.json'.
This can be used to test different document types or to test different JSON layouts for the same document type.

Define queries and test data

Any number of queries can be put into the folder 'scenarios'.

Each one needs be named like 'query.NAME.sql'. For having test data for the queries inside the database, one or multiple 'querydata.NAME.json' files can be used.

Define index policies

Any number of indexing policies can be put into the folder 'scenarios'.

Each one needs be named like 'indexpolicy.NAME.json'.
This can be used to test the impact of indexing for the various document operations.

Configure Azure Cosmos DB account endpoint and key

A file 'config.json', which contains the Azure Cosmos DB account endpoint and key, needs to be available inside the root folder.

The file 'config.template.json' can be used as a blueprint.

RUN IT!

This project can be used run with 'dotnet run' executed inside the root.
.NET Core needs to be installed.

What happens then?

The console application tests all combinations of

  • Consistency Level
  • the defined Indexing Policies
  • the defined Documents & Queries

For each document and the possible operation the following is tracked:

  • original document size
  • document size inside CosmosDB (with metadata, without formatting)
  • request units charge for each operation

For each query the following is tracked:

  • count of items returned
  • total size of all items returned
  • request units charge

After that it generates a 'results.csv' with all the results.

Analyze the results

Open the 'results.csv' file in Excel or something else.

These real numbers can then be used for any design decisions and for calculating the request units needed.

azurecosmosdb-requestunitstester's People

Contributors

ricardoniepel avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.