Skip to content

Commit

Permalink
Add pingtracer
Browse files Browse the repository at this point in the history
  • Loading branch information
cmorty committed Jun 7, 2020
1 parent d99e44a commit 35cf041
Show file tree
Hide file tree
Showing 7 changed files with 186 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pingtracer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# <img src="https://raw.githubusercontent.com/bp2008/pingtracer/master/PingTest/PingTest/pingtracer.ico" width="48" height="48"/> [Ping tracer](https://github.com/bp2008/pingtracer/)

## Features

This program helps to visually determine the origin of connection problems. The latency over time is shown on graphs, and each instance of packet loss is marked in red.

A common use for such a tool is to monitor your connection to a multiplayer game server so you know who to blame when you experience lag. For example, if you experience a terrible moment of lag and you see that every node beyond your router is showing elevated latency or packet loss, then the lag was on your end. Typically, a poorly performing node will affect your connection to every node after it.

I built this program for personal use, and decided to share it for free as an open source project. As such, it is light on features and polish.

Something you should be aware of is that when you attempt to "Graph every node leading to the destination", a trace route operation is performed in order to discover the hosts that will be monitored.

* The trace route operation is not optimized for speed, and will take many seconds to complete in most cases.
* The trace route operation attempts to contact each host (a.k.a. network node) only once. Any host that fails to respond during the trace route operation will not be monitored.
* The trace route operation is ended if 5 consecutive hosts fail to respond. This usually indicates that the destination host was already passed by and did not respond to the trace ping.
* Some hosts respond to the traceroute but do not respond to direct pings. Technically it would still be possible to monitor these hosts by repeating their part of the traceroute, but I assume this would be against the wishes of the owner of the host. If the owner wanted their router to be pingable, they would have enabled pinging, no?
* I let you increase the ping rate as high as 10 pings per second (per host!) which can add up to dozens or even hundreds of pings per second. This is kind of, sort of, maybe a little bit excessive. I don't recommend actually running it that high. In fact 1 ping per second is probably all you need.

![screenshot](http://i.imgur.com/g5jmH0W.png)
48 changes: 48 additions & 0 deletions pingtracer/pingtracer.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Do not remove this test for UTF-8: if “Ω” doesn’t appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>pingtracer</id>
<version>0.0</version>
<title>Ping Tracer</title>
<owners>Morty</owners>
<authors>bp2008</authors>
<licenseUrl>https://github.com/bp2008/pingtracer/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/bp2008/pingtracer</projectUrl>
<projectSourceUrl>https://github.com/bp2008/pingtracer</projectSourceUrl>
<docsUrl>https://github.com/bp2008/pingtracer</docsUrl>
<!-- <mailingListUrl></mailingListUrl> -->
<bugTrackerUrl>https://github.com/bp2008/pingtracer/issues</bugTrackerUrl>
<iconUrl>https://raw.githubusercontent.com/bp2008/pingtracer/master/PingTest/PingTest/pingtracer.ico</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<summary>Ping Tracer continuously pings each network host between your computer and a given destination, helping identify the source of connectivity problems.</summary>
<description><![CDATA[## Features
This program helps to visually determine the origin of connection problems. The latency over time is shown on graphs, and each instance of packet loss is marked in red.
A common use for such a tool is to monitor your connection to a multiplayer game server so you know who to blame when you experience lag. For example, if you experience a terrible moment of lag and you see that every node beyond your router is showing elevated latency or packet loss, then the lag was on your end. Typically, a poorly performing node will affect your connection to every node after it.
I built this program for personal use, and decided to share it for free as an open source project. As such, it is light on features and polish.
Something you should be aware of is that when you attempt to "Graph every node leading to the destination", a trace route operation is performed in order to discover the hosts that will be monitored.
* The trace route operation is not optimized for speed, and will take many seconds to complete in most cases.
* The trace route operation attempts to contact each host (a.k.a. network node) only once. Any host that fails to respond during the trace route operation will not be monitored.
* The trace route operation is ended if 5 consecutive hosts fail to respond. This usually indicates that the destination host was already passed by and did not respond to the trace ping.
* Some hosts respond to the traceroute but do not respond to direct pings. Technically it would still be possible to monitor these hosts by repeating their part of the traceroute, but I assume this would be against the wishes of the owner of the host. If the owner wanted their router to be pingable, they would have enabled pinging, no?
* I let you increase the ping rate as high as 10 pings per second (per host!) which can add up to dozens or even hundreds of pings per second. This is kind of, sort of, maybe a little bit excessive. I don't recommend actually running it that high. In fact 1 ping per second is probably all you need.
![screenshot](http://i.imgur.com/g5jmH0W.png)
]]></description>
<releaseNotes>https://github.com/bp2008/pingtracer/releases/tag/1.8</releaseNotes>
<copyright />
<tags>ping traceroute</tags>
<packageSourceUrl>https://github.com/cmorty/au-packages/</packageSourceUrl>
<dependencies>
<dependency id="chocolatey-core.extension" version="1.0" />
</dependencies>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>
21 changes: 21 additions & 0 deletions pingtracer/tools/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 bp2008

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
18 changes: 18 additions & 0 deletions pingtracer/tools/VERIFICATION.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
VERIFICATION
Verification is intended to assist the Chocolatey moderators and community
in verifying that this package's contents are trustworthy.

The binary can been downloaded using the official download link found at https://github.com/bp2008/pingtracer/releases
This package has been built using Appveyor.
You can find the package source at https://github.com/cmorty/au-packages/tree/master/pingtracer
As well as the build logs at: https://gist.github.com/cmorty/554cd2b607b7bf0a288341da3b311ca1

To verify the package you need to
1. Download the zip from the following
URL: https://github.com/bp2008/pingtracer/releases/download/1.8/PingTracer.1.8.zip
2. You can use one of the following methods to obtain the checksum
- Use powershell function 'Get-Filehash'
- Use chocolatey utility 'checksum.exe'

checksum type: sha256
checksum32: 292777976917364EA471BFED8CCDEF105761521DD90BDF0092D043B3856BFE04
29 changes: 29 additions & 0 deletions pingtracer/tools/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
$ErrorActionPreference = 'Stop'


$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"


$packageArgs = @{
unzipLocation = "$toolsDir"
packageName = "pingtracer"
file = 'tools/PingTracer.1.8_x32.zip'
checksum = '292777976917364EA471BFED8CCDEF105761521DD90BDF0092D043B3856BFE04'
checksumType = 'sha256'
}


Write-Verbose "Unpacking"
Install-ChocolateyZipPackage @packageArgs

Write-Verbose "Searching for exe"
$files = get-childitem "$toolsdir" -include "*.exe" -recurse


# This will create a Shim for all exe and will add a line chocoUninstall.ps1 to remove it on uninstall
foreach ($file in $files) {
Write-Verbose "Crating Start Menu enty for $($file.BaseName)"
$newlink ="$($env:ProgramData)\Microsoft\Windows\Start Menu\Programs\$($file.BaseName).lnk"
Install-ChocolateyShortcut -shortcutFilePath $newlink -targetPath "$file"
Add-Content "$toolsdir\chocoUninstall.ps1" -Value "Remove-Item `"$($newlink)`" -Force -ea ignore"
}
4 changes: 4 additions & 0 deletions pingtracer/tools/chocolateyUninstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"

. $toolsdir\chocoUninstall.ps1
47 changes: 47 additions & 0 deletions pingtracer/update.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import-module au

$domain = 'https://github.com'
$ghproj = 'bp2008/pingtracer'
$releases = "$domain/$ghproj/releases/latest"

function global:au_SearchReplace {
@{
".\tools\chocolateyInstall.ps1" = @{
"(?i)(^\s*file\s*=\s*)('.*')" = "`$1'tools/$($Latest.Filename32)'"
"(?i)(^\s*checksum\s*=\s*)('.*')" = "`$1'$($Latest.Checksum32)'"
"(?i)(^\s*checksumType\s*=\s*)('.*')" = "`$1'$($Latest.ChecksumType32)'"
}
".\pingtracer.nuspec" = @{
"\<releaseNotes\>.+" = "<releaseNotes>$($Latest.ReleaseNotes)</releaseNotes>"
}
".\tools\VERIFICATION.txt" = @{
"(?i)(URL:).*" = "`${1} $($Latest.URL32)"
"(?i)(checksum type:).*" = "`${1} $($Latest.ChecksumType32)"
"(?i)(checksum32:).*" = "`${1} $($Latest.Checksum32)"
}
}
}


function global:au_BeforeUpdate { Get-RemoteFiles -Purge }

function global:au_GetLatest {
#$ProgressPreference = 'SilentlyContinue'
$download_page = Invoke-WebRequest -UseBasicParsing -Uri $releases

$re = '\.zip$'
$url = $download_page.links | ? href -match $re | select -First 1 -expand href

$version = ($url -split '/' | Select-Object -Last 1 -Skip 1 )

$releaseNotesUrl = $download_page.BaseResponse.ResponseUri.AbsoluteUri

@{
URL32 = $domain + $url
Version = $version
ReleaseNotes = $releaseNotesUrl
}
}


update -ChecksumFor none

0 comments on commit 35cf041

Please sign in to comment.