liveBook · Manning

Measurement

As explained in .NET in Action, Second Edition

A measurement is a quantified observation of a software or system characteristic such as execution time or resource usage.

A measurement is a quantified observation recorded by a device sensor. In an air-conditioning API, each measurement identifies a sensor, reports a numeric value, and supplies a human-readable description. section 12.1

A measurement payload typically includes:

  • A sensor name such as ExhaustAirTemp or CoolantTemp. section 12.1
  • A decimal value representing the observed quantity. section 12.1
  • A description suitable for consumers of the API. section 12.1
  • A timestamp and unit identity that locate the observations in time and space. section 12.1
Listing 12.1 Example response from the air conditioner's API
{
  "UnitId": 1,                                     #1
  "Site": "TIJ1",
  "Timestamp": "2022-10-10T00:05:00.000Z",         #2
  "Measurements": {
    [
      "SensorName": "ExhaustAirTemp",              #3
      "Value": 15.2,
      "Description": "Exhaust Air Temperature"     #4
    ],
    [
      "SensorName": "CoolantTemp",
      "Value": 3.4,                                #5
      "Description": "Coolant Temperature"
    ],
    [
      "SensorName": "OutsideAirTemp",
      "Value": 24.1,
      "Description": "Outside Air Temperature"
    ]
  }
}

Inspect a concrete JSON response containing unit metadata, a UTC timestamp, and several sensor measurements. section 12.1

How .NET in Action, Second Edition covers it

How deep it goes
Defines measurement data and models it in C#, but defers persistence, live updates, and historical retrieval.
Examples
Uses exhaust-air, coolant, and outside-air temperature readings in a JSON response and C# record model.
What it assumes
Assumes familiarity with C#, ASP.NET Core web APIs, HTTP endpoints, and basic automated testing.
What you can do after
Build an endpoint that returns typed measurements and verify its successful HTTP response with an integration test.
How it connects
Connects sensor data with HTTP APIs, IoT devices, UTC timestamps, DateTimeOffset, and integration testing.

Also explained in

Compare how 4 books explain measurement →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of .NET in Action, Second Edition. The section links point to the parts of the book it draws on.