Skip to content

Getting started (5 min)

This page presents basic queries that can be used to generate and use consumption profiles.

You use curl in command line to query Boavizta demo (public) API.

💡 You can format the results by using jq (curl -X 'GET' 'https://api.boavizta.org/v1/consumption_profile/cpu' | jq)

Generate a cpu consumption profile from TDP

In this query we generate consumption profile parameters (a,b,c,d) from a TDP and a model_range

cpu_consumption_profile(workload) = a * ln(b*(workload + c)) + d

curl -X 'POST' \
  'https://api.boavizta.org/v1/consumption_profile/cpu' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
   "cpu": {
    "name": "intel xeon gold 6134",
    "tdp": 130
    }
  }'

Result :

The API will select the average xeon gold consumption profile and adapt it with a TDP of 130 Watt.

{
    "a": 35.5688,
    "b": 0.2438,
    "c": 9.6694,
    "d": -0.6087
}

Generate a cpu consumption profile from workloads

In this query we generate consumption profile parameters (a,b,c,d) from a workload datapoints and a model_range

cpu_consumption_profile(workload) = a * ln(b*(workload + c)) + d

curl -X 'POST' \
  'https://api.boavizta.org/v1/consumption_profile/cpu' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "cpu": {
    "name": "intel xeon gold 6134"
  },
  "workload": [
    {
      "load_percentage": 0,
      "power_watt": 50
    },
    {
      "load_percentage": 10,
      "power_watt": 100
    },
    {
      "load_percentage": 50,
      "power_watt": 180
    },
    {
      "load_percentage": 100,
      "power_watt": 245
    }
  ]
}'

Result :

The API will select the average xeon gold consumption profile and adapt it to match the given datapoints

{
    "a": 105.9490625645529,
    "b": 0.08276489427342926,
    "c": 19.892145752325938,
    "d": -0.7237683566860724
}

For further information see : The explanation page on consumption profiles