Explorar o código

inital commit

David %!s(int64=9) %!d(string=hai) anos
pai
achega
a7f03e65b5
Modificáronse 3 ficheiros con 13 adicións e 0 borrados
  1. 1 0
      .gitignore
  2. 3 0
      make_noise.sh
  3. 9 0
      speedtest.sh

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+noise

+ 3 - 0
make_noise.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+rm -f noise
+dd if=/dev/urandom bs=1M count=10 of=noise

+ 9 - 0
speedtest.sh

@@ -0,0 +1,9 @@
+#!/bin/bash
+
+size=$(du noise | awk '{ print $1 }')
+start=$(date +%s)
+ssh especificosba.com.ar "cat >/dev/null" < noise
+finish=$(date +%s)
+kbps=$(echo "scale=2; ($size)/($finish-$start)" | bc)
+
+curl -s -i -XPOST 'http://graphs.eba:8086/write?db=curso' --data-binary "speed,type=up value=$kbps" >/dev/null