TravelyzerTravelyzerDocs

SLA History

Historical SLA metrics for trend analysis.

GET /sla-history

Returns the history of SLA metrics over a given period. Ideal for trend analysis, report generation, and dashboard visualization.

Endpoint

GET https://places.gotravelyzer.com/sla-history

Authentication

This endpoint does not require authentication and is not counted against your quotas.


Parameters

Query Parameters

ParameterTypeRequiredDescriptionDefault
hoursintegerNoNumber of hours of history24

Requests

Last 24 Hours History (default)

curl "https://places.gotravelyzer.com/sla-history"

Last 48 Hours History

curl "https://places.gotravelyzer.com/sla-history?hours=48"

Last 12 Hours History

curl "https://places.gotravelyzer.com/sla-history?hours=12"

Response

Success (200 OK)

{
  "period": "last_24h",
  "window": "5m",
  "points": [
    {
      "timestamp": "2026-02-23T10:00:00.000Z",
      "p95": 15,
      "successRate": 99.8
    },
    {
      "timestamp": "2026-02-23T10:05:00.000Z",
      "p95": 18,
      "successRate": 99.5
    },
    {
      "timestamp": "2026-02-23T10:10:00.000Z",
      "p95": 12,
      "successRate": 99.9
    }
  ]
}

Response Fields

Metadata

FieldTypeDescription
periodstringRequested period (e.g., last_24h, last_48h)
windowstringInterval between each point (e.g., 5m = 5 minutes)
pointsarrayArray of data points

Data Points

FieldTypeDescription
timestampstringPoint timestamp (ISO 8601, UTC)
p95number95th percentile latency in milliseconds
successRatenumberSuccess rate as percentage (0-100)

Points are spaced 5 minutes apart. Periods without traffic may be omitted.


HTTP Codes

CodeStatusDescription
200OKHistory returned successfully
400Bad RequestInvalid hours parameter
503Service UnavailableMetrics service unavailable

Use Cases

Calculate statistics over the period:

#!/bin/bash
 
HISTORY=$(curl -s "https://places.gotravelyzer.com/sla-history?hours=24")
 
# Number of data points
POINTS_COUNT=$(echo $HISTORY | jq '.points | length')
echo "Data points: $POINTS_COUNT"
 
# Average P95 latency
AVG_P95=$(echo $HISTORY | jq '[.points[].p95] | add / length')
echo "Average P95 latency: ${AVG_P95}ms"
 
# Max P95 latency
MAX_P95=$(echo $HISTORY | jq '[.points[].p95] | max')
echo "Max P95 latency: ${MAX_P95}ms"
 
# Average success rate
AVG_SUCCESS=$(echo $HISTORY | jq '[.points[].successRate] | add / length')
echo "Average success rate: ${AVG_SUCCESS}%"
 
# Min success rate
MIN_SUCCESS=$(echo $HISTORY | jq '[.points[].successRate] | min')
echo "Min success rate: ${MIN_SUCCESS}%"

Detect Anomalies

Identify periods with degraded metrics:

#!/bin/bash
 
HISTORY=$(curl -s "https://places.gotravelyzer.com/sla-history?hours=24")
 
# Identify latency spikes (P95 > 100ms)
echo "Latency spikes (P95 > 100ms):"
echo $HISTORY | jq '.points[] | select(.p95 > 100) | "\(.timestamp): \(.p95)ms"'
 
# Identify availability drops (< 99%)
echo "Availability drops (< 99%):"
echo $HISTORY | jq '.points[] | select(.successRate < 99) | "\(.timestamp): \(.successRate)%"'

Generate SLA Compliance Report

#!/bin/bash
 
HISTORY=$(curl -s "https://places.gotravelyzer.com/sla-history?hours=24")
 
# SLA thresholds
P95_THRESHOLD=200      # ms
SUCCESS_THRESHOLD=99   # %
 
# Count violations
TOTAL_POINTS=$(echo $HISTORY | jq '.points | length')
P95_VIOLATIONS=$(echo $HISTORY | jq "[.points[] | select(.p95 > $P95_THRESHOLD)] | length")
SUCCESS_VIOLATIONS=$(echo $HISTORY | jq "[.points[] | select(.successRate < $SUCCESS_THRESHOLD)] | length")
 
# Calculate compliance
P95_COMPLIANCE=$(echo "scale=2; (1 - $P95_VIOLATIONS / $TOTAL_POINTS) * 100" | bc)
SUCCESS_COMPLIANCE=$(echo "scale=2; (1 - $SUCCESS_VIOLATIONS / $TOTAL_POINTS) * 100" | bc)
 
echo "=== 24H SLA REPORT ==="
echo "Points analyzed: $TOTAL_POINTS"
echo ""
echo "P95 Latency:"
echo "  - Threshold: ${P95_THRESHOLD}ms"
echo "  - Violations: $P95_VIOLATIONS"
echo "  - Compliance: ${P95_COMPLIANCE}%"
echo ""
echo "Success Rate:"
echo "  - Threshold: ${SUCCESS_THRESHOLD}%"
echo "  - Violations: $SUCCESS_VIOLATIONS"
echo "  - Compliance: ${SUCCESS_COMPLIANCE}%"

Export for Visualization

Export data to CSV format:

#!/bin/bash
 
HISTORY=$(curl -s "https://places.gotravelyzer.com/sla-history?hours=24")
 
echo "timestamp,p95_ms,success_rate"
echo $HISTORY | jq -r '.points[] | "\(.timestamp),\(.p95),\(.successRate)"'

Example output:

timestamp,p95_ms,success_rate
2026-02-23T10:00:00.000Z,15,99.8
2026-02-23T10:05:00.000Z,18,99.5
2026-02-23T10:10:00.000Z,12,99.9

Useful Calculations

Average Over Period

# Average P95 latency
curl -s "https://places.gotravelyzer.com/sla-history" | \
  jq '[.points[].p95] | add / length | round'
 
# Average success rate
curl -s "https://places.gotravelyzer.com/sla-history" | \
  jq '[.points[].successRate] | add / length * 100 | round / 100'

Minimum and Maximum

# Max P95 latency (worst case)
curl -s "https://places.gotravelyzer.com/sla-history" | \
  jq '[.points[].p95] | max'
 
# Min success rate (worst case)
curl -s "https://places.gotravelyzer.com/sla-history" | \
  jq '[.points[].successRate] | min'

Technical Notes

  • Points are generated every 5 minutes
  • Periods without traffic may be omitted (no empty points)
  • This endpoint is not subject to rate limits
  • Timestamps are in UTC (ISO 8601 format)
  • These are informational metrics, not contractual guarantees

Next Steps