Skip to content

Commit

Permalink
Merge pull request #196 from kmvan/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
kmvan authored Dec 14, 2022
2 parents e21f760 + cad221d commit c0f3261
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 15 deletions.
4 changes: 2 additions & 2 deletions AppConfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"APP_VERSION": "8.15",
"APP_VERSION": "8.16",
"APP_NAME": "X Prober",
"APP_URL": "https://github.com/kmvan/x-prober",
"AUTHOR_URL": "https://inn-studio.com/prober",
Expand All @@ -16,7 +16,7 @@
"APP_TEMPERATURE_SENSOR_PORTS": [2048, 4096],
"AUTHOR_NAME": "INN STUDIO",
"LATEST_PHP_STABLE_VERSION": "8",
"LATEST_NGINX_STABLE_VERSION": "1.20.1",
"LATEST_NGINX_STABLE_VERSION": "1.22.0",
"BENCHMARKS": [
{
"name": "Olink / AMD-3700X / PHP80 JIT",
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@

All Notable changes to `X-Prober` will be documented in this file

## 8.16.0 - 2022-12-14

### Add

- Add server benchmark cooldown config

## 8.15.0 - 2022-12-08

### Optimize

- Optimize style
-

## 8.14.0 - 2022-11-14

### Add
Expand Down
2 changes: 1 addition & 1 deletion dist/prober.php

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
},
"devDependencies": {
"@types/core-js": "^2.5.5",
"@types/node": "^18.11.11",
"@types/node": "^18.11.15",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9",
"@typescript-eslint/eslint-plugin": "^5.45.1",
"@typescript-eslint/parser": "^5.45.1",
"@typescript-eslint/eslint-plugin": "^5.46.1",
"@typescript-eslint/parser": "^5.46.1",
"css-loader": "^6.7.2",
"deep-sort-object": "^1.0.2",
"eslint": "^8.29.0",
Expand All @@ -42,7 +42,7 @@
"fast-glob": "^3.2.12",
"mini-css-extract-plugin": "^2.7.2",
"prettier": "^2.8.1",
"sass": "^1.56.1",
"sass": "^1.56.2",
"sass-loader": "^13.2.0",
"style-loader": "^3.3.1",
"terser-webpack-plugin": "^5.3.6",
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Config/ConfigApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class ConfigApi
{
public static $APP_VERSION = '8.15';
public static $APP_VERSION = '8.16';
public static $APP_NAME = 'X Prober';
public static $APP_URL = 'https://github.com/kmvan/x-prober';
public static $APP_CONFIG_URLS = array('https://raw.githubusercontent.com/kmvan/x-prober/master/AppConfig.json', 'https://api.inn-studio.com/download/?id=xprober-config');
Expand All @@ -18,5 +18,5 @@ class ConfigApi
public static $UPDATE_PHP_URLS = array('https://raw.githubusercontent.com/kmvan/x-prober/master/dist/prober.php', 'https://api.inn-studio.com/download/?id=xprober');
public static $AUTHOR_NAME = 'INN STUDIO';
public static $LATEST_PHP_STABLE_VERSION = '8';
public static $LATEST_NGINX_STABLE_VERSION = '1.20.1';
public static $LATEST_NGINX_STABLE_VERSION = '1.22.0';
}
13 changes: 9 additions & 4 deletions src/Components/ServerBenchmark/ServerBenchmarkApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace InnStudio\Prober\Components\ServerBenchmark;

use InnStudio\Prober\Components\Xconfig\XconfigApi;

class ServerBenchmarkApi
{
private $EXPIRED = 60;

public function getTmpRecorderPath()
{
return sys_get_temp_dir() . \DIRECTORY_SEPARATOR . 'xproberBenchmarkTimer';
return sys_get_temp_dir() . \DIRECTORY_SEPARATOR . 'xproberBenchmarkCool';
}

public function setRecorder(array $data)
Expand All @@ -19,7 +19,7 @@ public function setRecorder(array $data)
public function setExpired()
{
return (bool) $this->setRecorder(array(
'expired' => (int) $_SERVER['REQUEST_TIME'] + $this->EXPIRED,
'expired' => (int) $_SERVER['REQUEST_TIME'] + $this->cooldown(),
));
}

Expand Down Expand Up @@ -140,6 +140,11 @@ public function getPoints()
);
}

private function cooldown()
{
return (int) XconfigApi::get('serverBenchmarkCd') ?: 60;
}

private function getRecorder()
{
$path = $this->getTmpRecorderPath();
Expand Down
5 changes: 4 additions & 1 deletion xconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
// You can disable listed features: serverStatus, networkStats, ping, serverInfo, phpInfo, phpInfoDetail, phpDisabledFunctions, phpDisabledClasses, phpExtensions, phpExtensionsLoaded, database, myServerBenchmark, myInfo, serverIp
// "disabled": ["serverIp", "phpInfoDetail"],
//

// The server benchmark cooldown (seconds)
"serverBenchmarkCd": 30,

// You can set nodes for X-Prober
"nodes": [
["node-1", "http://localhost/prober/.tmp/"],
Expand Down

0 comments on commit c0f3261

Please sign in to comment.