Coder Social home page Coder Social logo

devcsrj / ispmon Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 1.18 MB

๐Ÿ“ˆ๐Ÿ”Your persistent ISP bandwidth monitor

License: MIT License

Dockerfile 0.65% JavaScript 6.61% HTML 0.21% Kotlin 70.33% PHP 22.19%
bandwith isp monitoring-tool vertx graal-native docker

ispmon's Introduction

ISPMON

GitHub

Your persistent ISP bandwidth monitor.

As a software engineer who relies on managed dependencies, the least of your concerns SHOULD be the managed dependencies. This is not the case in the country I am living in.

I am currently subscribed to my ISP's fiber connection offering. It promises no data cap, maxed at 25Mbps, but with a teeny tiny asterisk that says:

30% minimum speed at 80% service reliability.

Then came that night, when our internet speed dropped down to 1Mbps. I could've tolerated it if it only happened rarely. But it happened consistently at certain times of the day, and it made me realize that they might be throttling connections at specified times of the day.

To track that down (and soon nag about it), I started this project.

Running

You can download the jar from the releases, and run it with:

$ java -jar ispmon-1.0.0.jar

Or, if you're like me, who loves running applications on Docker:

$ docker run -p 5000:5000 -t -d --name ispmon devcsrj/ispmon:1.0.0

Configuration options below can be overridden with the --env argument. In addition, results are stored in a directory called results. To persists the results across container restarts, configure the volume. For example:

docker run -p 5000:5000 -t -d --volume /path/in/host:/opt/results --name ispmon devcsrj/ispmon:1.0.0

Configuring

The application reads the following from the environment variables:

  • ISPMON_INTERVAL=15 - (minutes) the interval at which, speed test should be done
  • ISPMON_DURATION=30 - (seconds) the maximum time to conduct speed tests
  • ISPMON_PORT=5000 - the port to run the web server
  • TZ - to set the timezone

Developing

Prerequisites

  • JDK 8

Tip: Use sdkman.

$ sdk install java 19.2.0-grl

Backend

To run the server:

$ ./gradlew run

It will then start a server at port 5000.

Frontend

The frontend resides under src/main/frontend. It also expects that the backend is running at port 5000.

$ cd src/main/frontend
$ yarn run start

This will start the webpack server at port 5001.

Building

To build a jar:

$ ./gradlew build

You can then run this with java -jar build/lib/ispmon-$version.jar.


FAQ

  • Have you tried switching to another ISP?

    Well, there's another ISP here, but I'd argue it's not any better. At work, I ran ispmon to see the results for comparison. I am staggered:

  • Did you really have to go this far?

    I also needed an excuse to play with new shiny things. This is my first project that involved:

    • The ultra-fast and lean Vertx
    • The coroutine-powered Ktor
    • The well-loved React
    • The smart bundler webpack
    • and the bleeding edge Graal Native Image

ispmon's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jijotski

ispmon's Issues

UnknownHostException on docker image

When running:

$ ./gradlew docker

the produced image devcsrj/ispmon:1.0.0-SNAPSHOT is not working. The exception shows:

โžœ  ispmon git:(master) โœ— docker run -p 5000:5000 devcsrj/ispmon:1.0.0-SNAPSHOT
Server running at 5000
Speedtest will be done every 15 minute(s)
Could not finish speedtest due to exception
java.net.UnknownHostException: www.speedtest.net
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:589)
	at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:666)
	at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)
	at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
	at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)
	at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
	at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:347)
	at com.github.devcsrj.ookla.Speedtest.loadSettings$ispmon(Speedtest.kt:97)
	at com.github.devcsrj.ookla.Speedtest.call(Speedtest.kt:29)
	at com.github.devcsrj.ispmon.Ispmon$speedtest$1.run(Ispmon.kt:118)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
	at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:460)
	at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.