E-Mail-Diagramm ist keine ASCII-Kunst für Sie

Aufgrund meiner Arbeit bin ich immer zwischen verschiedenen Abteilungen - ich habe nicht einmal eine Unterschrift in meiner E-Mail, wer ich bin, weil ich selbst nicht weiß, wer ich bin. Ich habe kürzlich die Bereitstellung von SQL-Servern mit Leistungsmetriken mit PROD an Entwickler automatisiert.





Spezifische Informationen (SQL-Leistungsmetriken) sind nicht wichtig. Sie können dies für alle Informationen tun und sogar Diagramme zeichnen. Diagramme werden per E-Mail gesendet und sehen im E-Mail-Fenster in Outlook ungefähr so ​​aus:





, , -, :





! ? , c? Web , , Grafana - ", "? , ASCII art-.





, , . . , , enterprise, .





-, PRODUCTION Enterprise (, CA PAM , copy/paste ). - , , .





-, , Grafana? , . " SQL PROD ". -, , ( security team) .





, on-prem, , . AWS ( PROD), , Department Billing Code, . , . Enterprise , - .





, email . , Grafana , screenshots. - . , ( - Junk )





connectivity (, , , ), , deploy (Jenkins, Octopus etc). - . , :





" - " (c) , Jenkins server, Job:





Jenkins powershell (, powershell Linux!) . performance , . :





makeChart $find @('3Read latency, microseconds','2Write Latency, microseconds') 'IO latency' 'Time' 'Times in microseconds' 'latency'
      
      



$find data set, . . makeChart:





# Xgraph colors
# 2 = red, 3 = blue, 4 = green, 5 = violet, 6 = orange, 7 = yellow, 8 = pink, 9 = cyan
function makeChart($ds, $cols, $title, $titleX, $titleY, $pngname)
{
	Out-File -FilePath $workfile -Force -Encoding ascii
	"Title = $title" | Add-Content $workfile  
	"title_x = $titleX" | Add-Content $workfile  
	"title_y = $titleY" | Add-Content $workfile
	$maxval = 0
	foreach ($c in $cols)
		{
		$colname = $c.Substring(1)
		$colch = $c[0]
		"color = $colch" | Add-Content $workfile
		$secf = -1
		foreach ($r in $find) {
			$val = $r[$colname]
			if ($val -gt $maxval) { $maxval = $val }
			if ($secf -lt 0) { $secf = $r.sec }
			$secl = $r.sec
			"$secl $val" | Add-Content $workfile
		}
	"NEXT" | Add-Content $workfile 
  }
  $maxval = $maxval * 1.03
      
      



- . ? Xgraph. 90 , , Unicode (-Encoding ascii). - , ! , . Xgraph:





&D:\Apps\Xgraph\bin\xgraph.exe $workfile -pdf -hms -x_range $secf $secl -y_range 0 $maxval -out_file $pdf
      
      



, y, x ( ), (-hms) ... pdf . attachment, , . Poppler pdf png.





&D:\Apps\poppler\bin\pdftoppm -png $pdf $pngname
      
      



:





Hier ist wieder extreme Programmierung - wir haben das nackte und saubere HTML des Post-Spill - kein CSS, kein Javascript und überhaupt nichts. Bitte beachten Sie, dass png '-1' im Namen hat. Dies ist die erste Seite (in diesem Fall die einzige).





Es gibt noch einen weiteren Nutzen eines ähnlichen Plans, mit dem Sie Diagramme gemäß ihrer Textbeschreibung zeichnen können: graphviz . Es kann bereits direkt auf png und jpg ausgegeben werden:





Dies ist ein Beispiel, da ich in einem anderen Job das Sperrdiagramm an Benutzer zurückgebe.








All Articles