Skip to main content

Graphs & Dash

AppScope is designed to send its data to existing metric and log tools for analytics, but the CLI contains some rudimentary ability to analyze data locally. Metrics can be graphed, and we provide a rich text interface dashboard, scope dash. Note that scope doesn't do well with only a few milliseconds of data. scope metrics -g and scope dash are designed to work with data over minutes of runtime.

Let's graph something simple, like CPU consumption over time. We've been running nginx in the background, so we have some data built up to graph. Let's see what kind of CPU nginx is consuming. First, in order to generate some HTTP data, we're going to start running requests every second in Terminal 2.

important

Graph CPU & FDs

  1. In Terminal 2, clear any running programs:
    ^C
  2. In Terminal 2, run:
    watch -n 2 ./https.sh
  3. In Terminal 1, to see CPU over time, run:
    scope metrics --id 1 -g -m proc.cpu_perc
  4. In Terminal 1, to see file descriptors over time, run:
    scope metrics --id 1 -g -m proc.fd

We can see the consumption of CPU over time and file descriptors over time. scope metrics can graph any metric over time. Additionally, AppScope also provides an interactive dashboard, scope dash. We're running continual requests with our watch command earlier, and scope dash will show all this traffic graphically.

important

Works with Everything

  1. In Terminal 1, run:
    scope dash --id 1

scope dash shows basic statistics like CPU and memory consumption, numbers of network connections and bytes in and out, plus filesystem and HTTP-level statistics. Additionally, it shows a continually scrolling set of events coming out of the application. You can even scroll in the log window. Check it out:

important

Clear Terminal 1

As cool as this display is, we'll need to free up Terminal 1 for our final set of demonstrations. This requires a little dexterity:

  1. To give Terminal 1 focus, click into its very bottom – below the Events pane's bottom border.
  2. In Terminal 1, type:
    ^C

Next, we'll use AppScope paired with Stream to capture and inspect live HTTP payloads!