File: memlog-view.R

package info (click to toggle)
node-shiny-server 1.5.20.1002-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,740 kB
  • sloc: javascript: 7,112; sh: 933; cpp: 303; python: 155; makefile: 34
file content (22 lines) | stat: -rw-r--r-- 589 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
library(ggplot2)
library(reshape2)
library(shiny)


memlog <- file.choose()
data <- reactiveFileReader(300, NULL, memlog, read.csv)

runApp(list(ui = basicPage(
    plotOutput("plot")
  ),
  server = function(input, output, session) {
    output$plot <- renderPlot({
      p <- ggplot(data = data(), aes(x = 1:nrow(data())))
      p <- p + geom_line(aes(y = rss), color = 'red')
      p <- p + geom_line(aes(y = heapTotal))
      p <- p + geom_line(aes(y = heapUsed))
      p <- p + geom_smooth(aes(y = rss), method = "loess")
      print(p)
    })
  }
), launch.browser = rstudio::viewer)