可视化SLA性能 [英] Visualzing SLA Performance

查看:167
本文介绍了可视化SLA性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我每个月都会为我们的高级领导撰写一份报告-它显示了I.T.表现.诸如事件解决,系统可用性等等之类的东西.我一直在寻找方法来可视化我拥有的一些数据,并找到了一个漂亮的表示形式,如下所示:

I author a report for our senior leadership each month - it shows I.T. performance. Things such as Incident resolution, system availability and so forth. I have been poking around for ways to visualize some of the data I have and found a beautiful representation, which is as follows:

我喜欢这种布局.我所有的报告都在RMarkdown中与一些混合LaTex一起使用.我一直在考虑如何在Rmarkdown中复制这样的内容,或者甚至只是使用嵌入在我的markdown文件中的原始LaTex ...我已经知道我可能可以使用sparklines包来获取sparklines,可以从中获取值和标题数据.我唯一的旅行就是整个事情.

I love this layout. All of my reporting is in RMarkdown with some mixed LaTex. I have been contemplating how to replicate something like this in Rmarkdown or maybe even just use raw LaTex embedded in my markdown files... I already know I can probably use the sparklines package to get the sparklines, the values and titles can be fed from the data. My only trip up, is the whole thing in its entirety.

我可以在ggplot中做类似的事情吗?也许使用晶格...我对如何将所有这些放在一起一无所知.

Can I do something like this in ggplot? Or maybe using lattice... I'm lost on how to put all of this together.

一些基本信息-我的数据集是R数据框.每行包含一个不同的系统或指标.将有一系列包含效果的列(计数和百分比).我设想了某种循环,该循环将构建每个框,然后以某种方式将其全部放入网格中.

Some basic information - my data sets are an R Dataframe. Each line contains a different system or metric. There would be a series of columns containing the performance (both counts and percentages). I envision some sort of loop that would build each box and then put it all in a grid somehow.

如果需要,我可以提供样本数据集,但是它们是非常基本的.字段/列类似于:名称,目标,2018年1月,2018年2月等.如果我需要某些指标的计数和百分比,则可能每个月都有包含计数和百分比的列.

I could provide a sample dataset if needed, but they are very basic. The fields/columns would be something like: name, target, Jan2018, Feb2018, etc.. If I need both counts and percentages for some metrics, I might have columns for each month that have both counts and percentages.

关于如何重现此事的任何想法?

Any ideas on how to reproduce this?

样本数据:

这是示例数据集.我希望迷你图成为百分比,但我也有每月的工作时间.显示的数字可以是年初至今的小时数和年初至今的百分比.抱歉,您的数据集过晚-我必须对其进行清理以删除机密信息.我已经添加了CSV和RData格式.再次感谢!

Here is a sample data set. I'd like the sparkline to be the percentage, but I also have the hours per month. The number displayed can be the YTD hours and YTD percentage. Sorry for the late data set - I had to sanitize this to take out confidential information. I have added both CSV and RData formats. Thanks again!

数据CSV文件

数据RData文件

推荐答案

这个问题涉及很多部分,我同意确切的解决方案将根据许多细节而有所不同的意见.但是,假设您正在寻找一种创建某种形式的静态仪表板的解决方案,则可以使用经过大量编辑的ggplot构建与此类似的内容.

This question has quite a lot of parts to it, and I agree with the comments that the exact solution will vary depending on a lot of the details. But assuming that you are looking for a solution which creates some form of static dashboard you could build something similar to this using a heavily edited ggplot.

我已经编写了一个函数metricplot,可以轻松创建许多较小的图表.它具有以下变量:

I have written a function metricplot which makes it easy to create lots of these smaller charts. It has the following variables:

  • df :包含数据的数据框
  • x & y :用于x和y轴的列
  • 标题:剧情的标题
  • 颜色:小部件的颜色
  • df: a dataframe containing the data
  • x & y: the columns to use for the x and y axes
  • title: the title of the plot
  • colour: the colour of the widget

这是函数:

#' Make a small metric plot
#' 
#' 
metricplot <- function(df, x, y, title, colour){

  # Find the change in values
  start <- df[[y]][1]
  end <- df[[y]][length(df)]
  change <- scales::percent((end - start)/start)


  plot <- 
    ggplot(df) +
    annotate("rect", xmin = -Inf, xmax = Inf, ymax = max(df[[y]] - 1), 
             ymin = min(df[[y]]), fill = "white", alpha = 0.5) +
    geom_line(aes_string(x, y), colour = "white", size = 2) +
    labs(title = title,
         subtitle = paste0(end, " / ", change)) +
    theme(axis.line=element_blank(),
          axis.text.x=element_blank(),
          axis.text.y=element_blank(),
          axis.ticks=element_blank(),
          axis.title.x=element_blank(),
          axis.title.y=element_blank(),legend.position="none",
          panel.background=element_blank(),
          panel.border=element_blank(),
          panel.grid.major=element_blank(),
          panel.grid.minor=element_blank(),
          plot.background = element_rect(fill = colour),
          plot.title = element_text(size = 20, colour = "white", face = "plain"),
          plot.subtitle = element_text(size = 40, colour = "white", face = "bold")) 

  return(plot)

}

将此功能与示例数据集结合使用:

Using this function with an example dataset:

 set.seed(123)
df2 <- data.frame(x = 1:20,
                  y = c(9, rep(10, 17), 12, 14),
                  z = c(14, rep(10, 17), 12, 11))

library(ggplot2)
library(ggthemes)

grid.arrange(metricplot(df2, "x", "y", "Metric 1", "#fc8d59"),
             metricplot(df2, "x", "y", "Metric 1", "#91cf60"),
             metricplot(df2, "x", "z", "Something Else", "#999999"),
             metricplot(df2, "x", "z", "One More", "#fc8d59"), ncol=4)

很明显,这已经对数据的格式做了一些假设,但希望它可以使您朝着正确的方向前进:)

Clearly, this has made a few assumptions about the format of the data but hopefully it can set you off in the right direction :)

这篇关于可视化SLA性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆