Servant Leadership and the Beauty of Failure

The following speech was given as the Keynote Address for the 2019 National Honors Society Induction Ceremony at Midland’s H.H. Dow High School Thank you so much Mr. Frye for that introduction and…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Data Visualization using FastAPI and EasyCharts

There are many useful insights that can be pulled from data if visualized for consumption.

There are a number of tools in existence which can provide data visualizations, but few which allow dynamic updates via an easy to use and consume API— Enter FastAPI & EasyCharts.

A FastAPI ‘plugin’ which can be used to create dynamically updating data visualizations in a web browser via a RestAPI.

Getting Started

Lets look into how create a basic chart that tracks your host / container / pod’s CPU & Memory Utilization using EasyCharts.

Additional dependencies for scheduling & collecting resource utilization

Within the fastapi application server startup actions, the scheduler is started, and ChartServer created.

The ChartServer accepts the FastAPI server, the name of the database to store chart data, and the default path to access charts.

Right away, the API provides the ability to view, create, update, and delete charts via the API.

A chart can be created via the API, or at our application startup. Any previously created Charts are automatically available.

When a chart is created, it should be initialized with labels (y) and data (x) values.

Viewing the Chart

Only a single datapoint(x,y) exists right now, since this was added with the creation of the chart.

Like creating a table, adding data to the chart can be performed both via API or via a background task on the server.

Restart the Chart Server

Our complete code should look similar to this.

Now the scheduler should begin to add datapoints for our host’s cpu & memory utilization every minute. Watch as the graph dynamically updates.

EasyCharts supports line & bar type graphs, which can be selected.

EasyCharts provides an easy way to visualize data, especially( but not limited to) data over time.

Add a comment

Related posts:

Reentrant Locks

Did you know you could give up to 50 claps? Yes, 50 claps, isn’t it awesome. If you feel my posts are interesting or helpful to you, please do press the 👏 clap button and share/ follow, help others…

Robots and the Great Depression in Retail

Amazon is eating the retail industry’s lunch. Walmart has finally woke to the challenge and is beefing up its stores with technology: online purchase and store pickup (BOPUS); smart shopping carts…

Crowdfunding Regeln

Die Grundidee von Crowdfunding ist immer dieselbe, egal um welche Art von Projekt es sich handelt: Der Starter versucht, Menschen davon zu überzeugen, ihn bei der Verwirklichung seiner Idee zu…