JeffersonLab / SRO-RTDP

1 stars 0 forks source link

Set up the node-graph-api backend in the Python main function #33

Closed cissieAB closed 7 months ago

cissieAB commented 8 months ago

Cont. to address issue #13

Launch it by:

(rdtp) bash-4.4$ python3 rtdp.py ../java/examples/helloworld/helloworld.yaml 
 * Serving Flask app 'rdtp_grafana_nodegraph'
 * Debug mode: on
 ...

The result from querying the url http://localhost:5000/api/graph/data will be ported to Grafana UI.

{
  "edges": [
    {
      "id": "1",
      "mainstat": 22,
      "source": "1",
      "target": "2",
      "thickness": 2
    },
    {
      "id": "2",
      "mainstat": 22,
      "source": "2",
      "target": "3",
      "thickness": 2
    }
  ],
  "nodes": [
    {
      "arc__failed": 0.7,
      "arc__passed": 0.3,
      "detail__class": "org.jlab.ersap.actor.helloworld.engine.FileReaderEngine",
      "id": "1",
      "mainstat": 1349,
      "title": "Source"
    },
    {
      "arc__failed": 0.7,
      "arc__passed": 0.3,
      "detail__class": "org.jlab.ersap.actor.helloworld.engine.HelloWorldEngine",
      "id": "2",
      "mainstat": 710,
      "title": "HelloWorld"
    },
    {
      "arc__failed": 0.7,
      "arc__passed": 0.3,
      "detail__class": "org.jlab.ersap.actor.helloworld.engine.PrintStdIOEngine",
      "id": "3",
      "mainstat": 1431,
      "title": "Sink"
    }
  ]
}