Skip to content

Instantly share code, notes, and snippets.

@adeekshith
Created May 5, 2015 02:31
Show Gist options
  • Save adeekshith/ed1b319db84dc0d4972d to your computer and use it in GitHub Desktop.
Save adeekshith/ed1b319db84dc0d4972d to your computer and use it in GitHub Desktop.
Simple website monitoring script in Mathematica to monitor and visualize any given website performance over time.
(* Monitors given website load time and plots it *)
dataLength = 400;
timeTakenUrlReq :=
First@AbsoluteTiming[Import["http://google.com/"]];
timeTakenTime := {DateList[], timeTakenUrlReq};
data = {timeTakenTime};
Dynamic[Last[AppendTo[data, timeTakenTime]], UpdateInterval -> 10,
TrackedSymbols -> {}]
Dynamic[If[Length[data] < dataLength, Length[data = data],
Length[data = data[[-dataLength ;;]]]]]
Dynamic[DateListPlot[data, Joined -> True, ImageSize -> Full,
ClippingStyle -> Automatic, Filling -> Bottom, PlotTheme -> "Web",
PlotRange -> Full], SynchronousUpdating -> False]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment