Skip to content

Commit

Permalink
change 'benchmark' command to 'bench'.
Browse files Browse the repository at this point in the history
'benchmark timeout' is changed to
'benchmark bans'.
  • Loading branch information
Embstj committed Sep 27, 2019
1 parent 03ad353 commit 372e63e
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 21 deletions.
2 changes: 1 addition & 1 deletion build/bash/benchmark → build/bash/bench
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
#along with this program. If not, see <http://www.gnu.org/licenses/>.

mydir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
pwsh -command "$(< $mydir/dir.sh)/build/powershell/scripts/benchmark.ps1 $1 $2 $3"
pwsh -command "$(< $mydir/dir.sh)/build/powershell/scripts/bench.ps1 $1 $2 $3"
2 changes: 1 addition & 1 deletion build/cmd/benchmark.bat → build/cmd/bench.bat
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@echo off
pushd %~dp0
set /p CMDDIR=<dir.txt
pwsh -ExecutionPolicy Bypass -command "set-location ""%CMDDIR%\build\powershell\scripts""; .\benchmark.ps1 %*"
pwsh -ExecutionPolicy Bypass -command "set-location ""%CMDDIR%\build\powershell\scripts""; .\bench.ps1 %*"
40 changes: 31 additions & 9 deletions build/powershell/scripts/benchmark.ps1 → build/powershell/scripts/bench.ps1
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#>

param(
[parameter(Position = 0, Mandatory = $true)]
[parameter(Position = 0, Mandatory = $false)]
[String]$command,
[parameter(Position = 1, Mandatory = $false)]
[String]$Name = $Null,
Expand All @@ -31,30 +31,30 @@ $Get = @()
Switch ($command) {
"help" {
$Get +=
"benchmark help guide
"bench help guide
benchmark miner [minername]
bench miner [minername]
-This will benchmark miner of given name. [minername] must match name
on 'get stats' screen.
-By Extension This will lift all bans on miner
benchmark algorithm [algoname]
bench algorithm [algoname]
-This will benchmark algorithm of given name. [algoname] must match name
on 'get stats' screen.
benchmark miner [minername] [algoname]
bench miner [minername] [algoname]
-This will benchmark on the algorithm of given name on the miner of the
given name. Both must match names on 'get stats' screen.
-By Extension This will lift all bans on miner
benchmark timeout
bench bans
-This will remove all bans.
benchmark all
bench all
-This will benchmark everything. CANNOT BE UNDONE!
"
}
"timeout" {
"bans" {
if (Test-Path ".\timeout") {Remove-Item ".\timeout" -Recurse -Force}
$Get += "Removed All Timeouts and Bans"
}
Expand Down Expand Up @@ -167,7 +167,29 @@ benchmark all
}
}
default {
$Get += "No Command Given"
$Get +=
"bench help guide
bench miner [minername]
-This will benchmark miner of given name. [minername] must match name
on 'get stats' screen.
-By Extension This will lift all bans on miner
bench algorithm [algoname]
-This will benchmark algorithm of given name. [algoname] must match name
on 'get stats' screen.
bench miner [minername] [algoname]
-This will benchmark on the algorithm of given name on the miner of the
given name. Both must match names on 'get stats' screen.
-By Extension This will lift all bans on miner
bench bans
-This will remove all bans.
bench all
-This will benchmark everything. CANNOT BE UNDONE!
"
}
}
$Get += "Effects will taked place after next miner benchmark/interval period."
Expand Down
8 changes: 4 additions & 4 deletions build/powershell/scripts/get.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -291,16 +291,16 @@ clear_watts
Clears all watt files
Resets power.json
benchmark
bench
USAGE:
[miner or algorithm] [name]
[timeout]
benchmark miner [name]
bench miner [name]
will clear all benchmarks for that miner
benchmark algorithm [name]
bench algorithm [name]
will clear all benchmarks for that algorithm
becchmark timeout
bench bans
will clear all bans
nview
Expand Down
6 changes: 3 additions & 3 deletions build/powershell/startup/linuxconfig.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,10 @@ function Global:Get-Data {
Set-Location $($(vars).dir)
}

if (Test-Path ".\build\bash\benchmark") {
Copy-Item ".\build\bash\benchmark" -Destination "/usr/bin" -force | Out-Null
if (Test-Path ".\build\bash\bench") {
Copy-Item ".\build\bash\bench" -Destination "/usr/bin" -force | Out-Null
Set-Location "/usr/bin"
Start-Process "chmod" -ArgumentList "+x benchmark"
Start-Process "chmod" -ArgumentList "+x bench"
Set-Location "/"
Set-Location $($(vars).dir)
}
Expand Down
6 changes: 3 additions & 3 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@ if (Test-Path ".\build\bash\dir.sh") {
Set-Location $Dir
}

if (Test-Path ".\build\bash\benchmark") {
Copy-Item ".\build\bash\benchmark" -Destination "/usr/bin" -force | Out-Null
if (Test-Path ".\build\bash\bench") {
Copy-Item ".\build\bash\bench" -Destination "/usr/bin" -force | Out-Null
Set-Location "/usr/bin"
Start-Process "chmod" -ArgumentList "+x benchmark"
Start-Process "chmod" -ArgumentList "+x bench"
Set-Location "/"
Set-Location $Dir
}
Expand Down

0 comments on commit 372e63e

Please sign in to comment.