Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
scx1332 committed Nov 17, 2023
1 parent 8d3ef0d commit ee08577
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 38 deletions.
4 changes: 2 additions & 2 deletions crates/erc20_rpc_pool/src/rpc_pool/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl Web3RpcEndpoint {
+ self.web3_rpc_info.penalty_from_head_behind as f64
+ self.web3_rpc_info.penalty_from_errors as f64;

let negative_score_exp = (-negative_score / 2000.0).exp();
let negative_score_exp = (-negative_score / 200.0).exp();
//negative_score_exp should be in 0 to 1 range
negative_score_exp * 75.0 + self.web3_rpc_info.bonus_from_last_chosen as f64
}
Expand All @@ -37,7 +37,7 @@ impl Web3RpcEndpoint {
}
let negative_score = self.web3_rpc_info.penalty_from_ms as f64
+ self.web3_rpc_info.penalty_from_head_behind as f64;
let negative_score_exp = (-negative_score / 2000.0).exp();
let negative_score_exp = (-negative_score / 200.0).exp();

negative_score_exp * 100.0
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,54 +244,30 @@
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
"mode": "continuous-greens"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"fillOpacity": 70,
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
"lineWidth": 0,
"spanNulls": false
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"color": "#707070",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
Expand All @@ -306,18 +282,21 @@
},
"id": 6,
"options": {
"alignValue": "left",
"legend": {
"calcs": [],
"displayMode": "table",
"placement": "right",
"showLegend": true,
"width": 200
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"mergeValues": true,
"rowHeight": 0.9,
"showValue": "auto",
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "10.2.1",
"targets": [
{
"datasource": {
Expand Down Expand Up @@ -346,7 +325,7 @@
}
}
],
"type": "timeseries"
"type": "state-timeline"
},
{
"datasource": {
Expand Down

0 comments on commit ee08577

Please sign in to comment.