Xojo Development – Crypto Currency Monitor – Update 8/10/2018

Xojo Threading

So I’ve spent the past few days going over how Xojo handles threading so that to improve the update mechanism. Previously, for the proof-of-concept, we were updating the UI via a simple timer. It wasn’t horrible, but it definitely showed its weakness when you started calling a number of json endpoints. Add in all of the parsing and then populating the listbox, things really slowed to a crawl. At best, it just flickered sometimes control repainting, but at worst, it would freeze the window. The problem with applications that are using threading, is that the Window and all of its functions are all happening within the same thread. So if you’re doing a heavy lifting task like HTTP Gets, parsing, and then listbox editing, you’re essentially competing with your parent thread for compute time. With a small sample size as what I have, this isn’t too much of an issue. However bigger farms will definitely feel the pain.

Threading can really be a pain though, when you are first getting into it. Most of my applications, where I need something quick and dirty, are single-threaded because they do just one task at a time: Populate the Database from the input-fields, grab results from database and populate objects, sit and wait. Very simple stuff, but when you need constant updates, as to be expected from a monitoring software, this because problematic.

Paved the way for JSON outputs

One of the ideas I threw out there for Cryto Currency Monitor was that I wanted to build an addon app for iOS. Well one of the ways to do that is to provide it with a single point of the data and present that data in a way that it can handle and parse. Each miner may¬†will have their own JSON schema, so there’s no point in providing that raw data to the iOS app to only have to duplicate our work that the Desktop app would be doing. So if the data I’m getting and using to populate the Desktop is parsed from a json source, and then I further build and modify it to being a JSON schema that I then use to populate the individual controls, I might as well take the fruits of that labor and provide it off to the iOS app. Below is a little Proof-Of-Concept that I use as the schema:

[
  {
    "miner_ip": "10.0.7.66:8082/getstat",
    "miner_type": "0",
    "miner_status": "Disconnected",
    "miner_gpus_connected": 0,
    "miner_speed": 0,
    "gpus": {}
  },
  {
    "miner_ip": "10.0.7.65:8082/getstat",
    "miner_type": "0",
    "miner_status": "Connected",
    "miner_gpus_connected": 2,
    "miner_speed": 818,
    "gpus": [
      {
        "gpu_name": "GeForce GTX 1070",
        "gpu_speed": "373"
      },
      {
        "gpu_name": "GeForce GTX 1070",
        "gpu_speed": "445"
      }
    ]
  },
  {
    "miner_ip": "10.0.7.67:8082/getstat",
    "miner_type": "0",
    "miner_status": "Disconnected",
    "miner_gpus_connected": 0,
    "miner_speed": 0,
    "gpus": {}
  }
]

It’s a simple layout, something that we all can understand. It just works! There’s still some missing things like temperature readouts, efficiency, and power (EWBF provides this), but it’s easily readable and can be worked out as needed.

What do you think?

Let me know in the comments what you think about this direction and what more I should focus on. Also reach out if you’re interested in being a beta tester!

Don’t forget to donate!

Xojo Projects

$
Select Payment Method
Personal Info

Donation Total: $5

Series Navigation<< Xojo Development – Centralized Crypto Monitoring

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.