Ping

The ping widget is used to display the outcome of a request to an API endpoint or website and report whether the response was a 200 and how long it took to get that response. If the response was 200, then the widget will remain orange. However, if the response is anything other than 200 the widget will be red.

Usage

  import PingWidget from '../widgets/ping/widget';
  <PingWidget
    name="GooglePing"
    title="Google"
  />

Props

Prop Description Required
name Name of widget. Used to update the widget when a job completes Yes
title Title of widget. Usually displayed above the metric value Yes
size Size of the widget: small (default) or medium can be used Optional

Data Stucture

When building a job for a ping widget, a status value and and time value should be sent e.g.

  // Successful
  data: {
    status: 200, // HTTP Status Code
    time: 726, // Request Time (ms)
  }

  // Failed
  data: {
    status: 500,
    time: 0,
  }

Example