Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Feb 13, 2024

Conversation

cissieAB
Copy link
Collaborator

@cissieAB cissieAB commented Feb 9, 2024

Cont. to address issue #13

  • Change the dash_cyto backend to the flask backend to create some data API for the Grafana node-graph visualization.
  • Link the data API at http://localhost:5000/api/graph/data to some local proxy Prometheus metrics. In the production code, we need to replace the proxy metrics with the real metrics.

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"
    }
  ]
}

@cissieAB cissieAB added the enhancement New feature or request label Feb 9, 2024
@cissieAB cissieAB self-assigned this Feb 9, 2024
@cissieAB cissieAB changed the title Set up the node-graph-api backend in the main Set up the node-graph-api backend in the Python main function Feb 9, 2024
@faustus123 faustus123 merged commit 4d839c7 into main Feb 13, 2024
@cissieAB cissieAB deleted the cissie_grafana branch February 13, 2024 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants