Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Local Development Tutorial

Adriana Stefanova edited this page Jan 9, 2018 · 6 revisions

In order to experiment with the metering service locally and see what suits your scenario best, you can follow the steps below.

1. Create a plan

Plans provide resource providers with a way to express the relationship between the measures and metrics. Based on what the plan is responsible for, there are three categories: metering, rating, and pricing.

There are a few predefined plans available in Abacus. You can find the examples with the metrics contained for each plan in the examples below.

Metering Plans
Rating Plans
  • Object storage - a rating plan for storage space and number of API calls.
  • Analytics - a rating plan for average number of instances and number of API calls.
  • Linux container - a rating plan for memory usage.
Pricing Plans

2. Rebuild and restart Abacus on your local machine

Note: Abacus requires Node.js >= 6.10.0 and Npm >= 3.10.10

Execute:

cd cf-abacus

# Bootstrap the build environment
# install the Node.js module dependencies and run the tests
npm run build

3. Submit your usage

In order to submit a usage document, you need to use a POST method, which records the resource usage document and processes the Cloud resource usage data it contains.

You can refer to the following sample script.

4. Get reports

In order to retrieve a previously submitted resource usage document, you need to use a GET method.

You can refer to the following sample script.

Clone this wiki locally