The model

What information should we record for the data points? We definitely need the name of the node that is sending the data. We also need to record the time at which we got the data point so that we can figure out the latest status of the node. Of course, we need to know the type and value of the data point. The type of the data point is simply the name of the quantity that we are measuring, such as CPU usage, memory usage, uptime, and so on.

For now, I think these are all the things that we need to measure:

  • Node name
  • Date and time
  • Type
  • Value

While thinking about which fields we needed in our model, I thought of another approach. It involved having a different model for each data point type, so we could have Django models named SystemLoad, MemoryUsage ...

Get Django Project Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.