API Reference
Create MetricCalculation
Create a new metric calculation. The metric calculation represents the
calculation of a metric for a specific time window, for example, the date
2020-01-01, or the hour 2020-01-01T01. It is a long running operation and
the current status can be seen in the state field of the
MetricCalculation.
POST
/
v1
/
metricCalculations
Create MetricCalculation
curl --request POST \
--url https://metrics.eu.confidence.dev/v1/metricCalculations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metricCalculationSpec": {
"metric": "<string>",
"exposureTable": "<string>",
"splitDimensions": [
{
"column": "<string>",
"factTable": "<string>",
"dimensionTable": "<string>",
"exposureTable": "<string>"
}
],
"measurementTable": "<string>",
"exposureGroups": [
"<string>"
]
},
"startTime": {},
"endTime": {},
"exposureEndTime": {},
"labels": [
{}
],
"owner": "<string>",
"endTimeConfig": {
"schedule": "<string>",
"availableData": {},
"exposureEndTime": {}
}
}
'import requests
url = "https://metrics.eu.confidence.dev/v1/metricCalculations"
payload = {
"metricCalculationSpec": {
"metric": "<string>",
"exposureTable": "<string>",
"splitDimensions": [
{
"column": "<string>",
"factTable": "<string>",
"dimensionTable": "<string>",
"exposureTable": "<string>"
}
],
"measurementTable": "<string>",
"exposureGroups": ["<string>"]
},
"startTime": {},
"endTime": {},
"exposureEndTime": {},
"labels": [{}],
"owner": "<string>",
"endTimeConfig": {
"schedule": "<string>",
"availableData": {},
"exposureEndTime": {}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metricCalculationSpec: {
metric: '<string>',
exposureTable: '<string>',
splitDimensions: [
{
column: '<string>',
factTable: '<string>',
dimensionTable: '<string>',
exposureTable: '<string>'
}
],
measurementTable: '<string>',
exposureGroups: ['<string>']
},
startTime: {},
endTime: {},
exposureEndTime: {},
labels: [{}],
owner: '<string>',
endTimeConfig: {schedule: '<string>', availableData: {}, exposureEndTime: {}}
})
};
fetch('https://metrics.eu.confidence.dev/v1/metricCalculations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://metrics.eu.confidence.dev/v1/metricCalculations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'metricCalculationSpec' => [
'metric' => '<string>',
'exposureTable' => '<string>',
'splitDimensions' => [
[
'column' => '<string>',
'factTable' => '<string>',
'dimensionTable' => '<string>',
'exposureTable' => '<string>'
]
],
'measurementTable' => '<string>',
'exposureGroups' => [
'<string>'
]
],
'startTime' => [
],
'endTime' => [
],
'exposureEndTime' => [
],
'labels' => [
[
]
],
'owner' => '<string>',
'endTimeConfig' => [
'schedule' => '<string>',
'availableData' => [
],
'exposureEndTime' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://metrics.eu.confidence.dev/v1/metricCalculations"
payload := strings.NewReader("{\n \"metricCalculationSpec\": {\n \"metric\": \"<string>\",\n \"exposureTable\": \"<string>\",\n \"splitDimensions\": [\n {\n \"column\": \"<string>\",\n \"factTable\": \"<string>\",\n \"dimensionTable\": \"<string>\",\n \"exposureTable\": \"<string>\"\n }\n ],\n \"measurementTable\": \"<string>\",\n \"exposureGroups\": [\n \"<string>\"\n ]\n },\n \"startTime\": {},\n \"endTime\": {},\n \"exposureEndTime\": {},\n \"labels\": [\n {}\n ],\n \"owner\": \"<string>\",\n \"endTimeConfig\": {\n \"schedule\": \"<string>\",\n \"availableData\": {},\n \"exposureEndTime\": {}\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://metrics.eu.confidence.dev/v1/metricCalculations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metricCalculationSpec\": {\n \"metric\": \"<string>\",\n \"exposureTable\": \"<string>\",\n \"splitDimensions\": [\n {\n \"column\": \"<string>\",\n \"factTable\": \"<string>\",\n \"dimensionTable\": \"<string>\",\n \"exposureTable\": \"<string>\"\n }\n ],\n \"measurementTable\": \"<string>\",\n \"exposureGroups\": [\n \"<string>\"\n ]\n },\n \"startTime\": {},\n \"endTime\": {},\n \"exposureEndTime\": {},\n \"labels\": [\n {}\n ],\n \"owner\": \"<string>\",\n \"endTimeConfig\": {\n \"schedule\": \"<string>\",\n \"availableData\": {},\n \"exposureEndTime\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://metrics.eu.confidence.dev/v1/metricCalculations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metricCalculationSpec\": {\n \"metric\": \"<string>\",\n \"exposureTable\": \"<string>\",\n \"splitDimensions\": [\n {\n \"column\": \"<string>\",\n \"factTable\": \"<string>\",\n \"dimensionTable\": \"<string>\",\n \"exposureTable\": \"<string>\"\n }\n ],\n \"measurementTable\": \"<string>\",\n \"exposureGroups\": [\n \"<string>\"\n ]\n },\n \"startTime\": {},\n \"endTime\": {},\n \"exposureEndTime\": {},\n \"labels\": [\n {}\n ],\n \"owner\": \"<string>\",\n \"endTimeConfig\": {\n \"schedule\": \"<string>\",\n \"availableData\": {},\n \"exposureEndTime\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"metricCalculationSpec": {
"metric": "<string>",
"exposureTable": "<string>",
"splitDimensions": [
{
"column": "<string>",
"factTable": "<string>",
"dimensionTable": "<string>",
"exposureTable": "<string>"
}
],
"measurementTable": "<string>",
"exposureGroups": [
"<string>"
]
},
"startTime": {},
"scheduleIteration": {},
"times": {
"exposureStartTime": {},
"exposureEndTime": {},
"factStartTime": {},
"factEndTime": {}
},
"createTime": {},
"updateTime": {},
"creator": "<string>",
"updater": "<string>",
"name": "<string>",
"endTime": {},
"state": "STATE_UNSPECIFIED",
"metricResults": {
"metricBucketStats": [
{
"summaryStats": {
"averageSummaryStats": {
"sum": 123,
"sumOfSquares": 123,
"count": 123,
"countMissing": 123,
"countMissingRows": 123,
"mean": 123,
"variance": 123,
"varianceReductionStats": {
"count": 123,
"countMissing": 123,
"countMissingRows": 123,
"sum": 123,
"postSum": 123,
"postCount": 123,
"sumOfSquares": 123,
"sumOfProducts": 123,
"mean": 123,
"variance": 123,
"covariance": 123
}
},
"ratioSummaryStats": {
"numeratorSum": 123,
"numeratorSumOfSquares": 123,
"denominatorSum": 123,
"denominatorSumOfSquares": 123,
"sumOfProducts": 123,
"count": 123,
"countMissing": 123,
"countMissingRows": 123,
"numeratorMean": 123,
"numeratorVariance": 123,
"denominatorMean": 123,
"denominatorVariance": 123,
"numeratorDenominatorCovariance": 123,
"varianceReductionStats": {
"count": 123,
"countMissing": 123,
"countMissingRows": 123,
"numeratorSum": 123,
"postNumeratorSum": 123,
"numeratorSumOfSquares": 123,
"denominatorSum": 123,
"postDenominatorSum": 123,
"denominatorSumOfSquares": 123,
"sumOfProducts": 123,
"numeratorNumeratorSumOfProducts": 123,
"numeratorDenominatorSumOfProducts": 123,
"denominatorNumeratorSumOfProducts": 123,
"denominatorDenominatorSumOfProducts": 123,
"numeratorMean": 123,
"numeratorVariance": 123,
"denominatorMean": 123,
"denominatorVariance": 123,
"numeratorDenominatorCovariance": 123,
"preNumeratorPostNumeratorCovariance": 123,
"preNumeratorPostDenominatorCovariance": 123,
"preDenominatorPostNumeratorCovariance": 123,
"preDenominatorPostDenominatorCovariance": 123
}
}
},
"variant": "<string>",
"dimensions": [
{
"dimension": "<string>",
"value": "<string>"
}
]
}
]
},
"schedule": "<string>",
"sqlJob": "<string>",
"supersededBy": "<string>",
"sql": "<string>",
"superseeds": "<string>",
"retriggered": true,
"outdatedSourceDataInfo": {
"table": "<string>",
"expectedCount": 123,
"actualCount": 123,
"queryStartTime": {},
"queryEndTime": {}
},
"error": "<string>",
"labels": [
{}
],
"owner": "<string>"
}Authorizations
Query Parameters
Body
application/json
Response
200 - application/json
Returns a MetricCalculation.
Represents the calculation of a metric for a specific time window.
Was this page helpful?
⌘I
Create MetricCalculation
curl --request POST \
--url https://metrics.eu.confidence.dev/v1/metricCalculations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metricCalculationSpec": {
"metric": "<string>",
"exposureTable": "<string>",
"splitDimensions": [
{
"column": "<string>",
"factTable": "<string>",
"dimensionTable": "<string>",
"exposureTable": "<string>"
}
],
"measurementTable": "<string>",
"exposureGroups": [
"<string>"
]
},
"startTime": {},
"endTime": {},
"exposureEndTime": {},
"labels": [
{}
],
"owner": "<string>",
"endTimeConfig": {
"schedule": "<string>",
"availableData": {},
"exposureEndTime": {}
}
}
'import requests
url = "https://metrics.eu.confidence.dev/v1/metricCalculations"
payload = {
"metricCalculationSpec": {
"metric": "<string>",
"exposureTable": "<string>",
"splitDimensions": [
{
"column": "<string>",
"factTable": "<string>",
"dimensionTable": "<string>",
"exposureTable": "<string>"
}
],
"measurementTable": "<string>",
"exposureGroups": ["<string>"]
},
"startTime": {},
"endTime": {},
"exposureEndTime": {},
"labels": [{}],
"owner": "<string>",
"endTimeConfig": {
"schedule": "<string>",
"availableData": {},
"exposureEndTime": {}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metricCalculationSpec: {
metric: '<string>',
exposureTable: '<string>',
splitDimensions: [
{
column: '<string>',
factTable: '<string>',
dimensionTable: '<string>',
exposureTable: '<string>'
}
],
measurementTable: '<string>',
exposureGroups: ['<string>']
},
startTime: {},
endTime: {},
exposureEndTime: {},
labels: [{}],
owner: '<string>',
endTimeConfig: {schedule: '<string>', availableData: {}, exposureEndTime: {}}
})
};
fetch('https://metrics.eu.confidence.dev/v1/metricCalculations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://metrics.eu.confidence.dev/v1/metricCalculations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'metricCalculationSpec' => [
'metric' => '<string>',
'exposureTable' => '<string>',
'splitDimensions' => [
[
'column' => '<string>',
'factTable' => '<string>',
'dimensionTable' => '<string>',
'exposureTable' => '<string>'
]
],
'measurementTable' => '<string>',
'exposureGroups' => [
'<string>'
]
],
'startTime' => [
],
'endTime' => [
],
'exposureEndTime' => [
],
'labels' => [
[
]
],
'owner' => '<string>',
'endTimeConfig' => [
'schedule' => '<string>',
'availableData' => [
],
'exposureEndTime' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://metrics.eu.confidence.dev/v1/metricCalculations"
payload := strings.NewReader("{\n \"metricCalculationSpec\": {\n \"metric\": \"<string>\",\n \"exposureTable\": \"<string>\",\n \"splitDimensions\": [\n {\n \"column\": \"<string>\",\n \"factTable\": \"<string>\",\n \"dimensionTable\": \"<string>\",\n \"exposureTable\": \"<string>\"\n }\n ],\n \"measurementTable\": \"<string>\",\n \"exposureGroups\": [\n \"<string>\"\n ]\n },\n \"startTime\": {},\n \"endTime\": {},\n \"exposureEndTime\": {},\n \"labels\": [\n {}\n ],\n \"owner\": \"<string>\",\n \"endTimeConfig\": {\n \"schedule\": \"<string>\",\n \"availableData\": {},\n \"exposureEndTime\": {}\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://metrics.eu.confidence.dev/v1/metricCalculations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metricCalculationSpec\": {\n \"metric\": \"<string>\",\n \"exposureTable\": \"<string>\",\n \"splitDimensions\": [\n {\n \"column\": \"<string>\",\n \"factTable\": \"<string>\",\n \"dimensionTable\": \"<string>\",\n \"exposureTable\": \"<string>\"\n }\n ],\n \"measurementTable\": \"<string>\",\n \"exposureGroups\": [\n \"<string>\"\n ]\n },\n \"startTime\": {},\n \"endTime\": {},\n \"exposureEndTime\": {},\n \"labels\": [\n {}\n ],\n \"owner\": \"<string>\",\n \"endTimeConfig\": {\n \"schedule\": \"<string>\",\n \"availableData\": {},\n \"exposureEndTime\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://metrics.eu.confidence.dev/v1/metricCalculations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metricCalculationSpec\": {\n \"metric\": \"<string>\",\n \"exposureTable\": \"<string>\",\n \"splitDimensions\": [\n {\n \"column\": \"<string>\",\n \"factTable\": \"<string>\",\n \"dimensionTable\": \"<string>\",\n \"exposureTable\": \"<string>\"\n }\n ],\n \"measurementTable\": \"<string>\",\n \"exposureGroups\": [\n \"<string>\"\n ]\n },\n \"startTime\": {},\n \"endTime\": {},\n \"exposureEndTime\": {},\n \"labels\": [\n {}\n ],\n \"owner\": \"<string>\",\n \"endTimeConfig\": {\n \"schedule\": \"<string>\",\n \"availableData\": {},\n \"exposureEndTime\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"metricCalculationSpec": {
"metric": "<string>",
"exposureTable": "<string>",
"splitDimensions": [
{
"column": "<string>",
"factTable": "<string>",
"dimensionTable": "<string>",
"exposureTable": "<string>"
}
],
"measurementTable": "<string>",
"exposureGroups": [
"<string>"
]
},
"startTime": {},
"scheduleIteration": {},
"times": {
"exposureStartTime": {},
"exposureEndTime": {},
"factStartTime": {},
"factEndTime": {}
},
"createTime": {},
"updateTime": {},
"creator": "<string>",
"updater": "<string>",
"name": "<string>",
"endTime": {},
"state": "STATE_UNSPECIFIED",
"metricResults": {
"metricBucketStats": [
{
"summaryStats": {
"averageSummaryStats": {
"sum": 123,
"sumOfSquares": 123,
"count": 123,
"countMissing": 123,
"countMissingRows": 123,
"mean": 123,
"variance": 123,
"varianceReductionStats": {
"count": 123,
"countMissing": 123,
"countMissingRows": 123,
"sum": 123,
"postSum": 123,
"postCount": 123,
"sumOfSquares": 123,
"sumOfProducts": 123,
"mean": 123,
"variance": 123,
"covariance": 123
}
},
"ratioSummaryStats": {
"numeratorSum": 123,
"numeratorSumOfSquares": 123,
"denominatorSum": 123,
"denominatorSumOfSquares": 123,
"sumOfProducts": 123,
"count": 123,
"countMissing": 123,
"countMissingRows": 123,
"numeratorMean": 123,
"numeratorVariance": 123,
"denominatorMean": 123,
"denominatorVariance": 123,
"numeratorDenominatorCovariance": 123,
"varianceReductionStats": {
"count": 123,
"countMissing": 123,
"countMissingRows": 123,
"numeratorSum": 123,
"postNumeratorSum": 123,
"numeratorSumOfSquares": 123,
"denominatorSum": 123,
"postDenominatorSum": 123,
"denominatorSumOfSquares": 123,
"sumOfProducts": 123,
"numeratorNumeratorSumOfProducts": 123,
"numeratorDenominatorSumOfProducts": 123,
"denominatorNumeratorSumOfProducts": 123,
"denominatorDenominatorSumOfProducts": 123,
"numeratorMean": 123,
"numeratorVariance": 123,
"denominatorMean": 123,
"denominatorVariance": 123,
"numeratorDenominatorCovariance": 123,
"preNumeratorPostNumeratorCovariance": 123,
"preNumeratorPostDenominatorCovariance": 123,
"preDenominatorPostNumeratorCovariance": 123,
"preDenominatorPostDenominatorCovariance": 123
}
}
},
"variant": "<string>",
"dimensions": [
{
"dimension": "<string>",
"value": "<string>"
}
]
}
]
},
"schedule": "<string>",
"sqlJob": "<string>",
"supersededBy": "<string>",
"sql": "<string>",
"superseeds": "<string>",
"retriggered": true,
"outdatedSourceDataInfo": {
"table": "<string>",
"expectedCount": 123,
"actualCount": 123,
"queryStartTime": {},
"queryEndTime": {}
},
"error": "<string>",
"labels": [
{}
],
"owner": "<string>"
}
