monitor AI remotes
This commit is contained in:
parent
c288f85e9a
commit
397d29e337
|
@ -12,16 +12,16 @@ private[app] final class AiStresser(env: lila.ai.Env, system: ActorSystem) {
|
|||
|
||||
def apply {
|
||||
|
||||
(1 to 10) foreach { i ⇒
|
||||
(1 to 20) foreach { i ⇒
|
||||
system.scheduler.scheduleOnce((i * 97) millis) {
|
||||
play(i % 8 + 1, true)
|
||||
}
|
||||
}
|
||||
(1 to 3) foreach { i ⇒
|
||||
system.scheduler.scheduleOnce((i * 131) millis) {
|
||||
analyse(true)
|
||||
}
|
||||
}
|
||||
// (1 to 3) foreach { i ⇒
|
||||
// system.scheduler.scheduleOnce((i * 131) millis) {
|
||||
// analyse(true)
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ object Monitor extends LilaController {
|
|||
private def env = Env.monitor
|
||||
|
||||
def index = Action {
|
||||
Ok(views.html.monitor.monitor())
|
||||
Ok(views.html.monitor.monitor(Env.ai.nbStockfishRemotes))
|
||||
}
|
||||
|
||||
def websocket = Socket[JsValue] { implicit ctx ⇒
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
@()
|
||||
@(nbAi: Int)
|
||||
|
||||
@layout("Lichess monitor") {
|
||||
<a class="back" href="@routes.Lobby.home">< back to lichess</a>
|
||||
|
@ -10,6 +10,7 @@
|
|||
<a href="#" id="shutdown">Emergency reactor shutdown - DON'T CLICK</a>
|
||||
</div>
|
||||
<script>
|
||||
var nbAi = @nbAi;
|
||||
window.document.getElementById("shutdown").onclick = function() {
|
||||
alert("Was worth trying. I guess.");
|
||||
};
|
||||
|
|
|
@ -78,6 +78,8 @@ final class Env(
|
|||
queue = stockfishQueue,
|
||||
config = stockfishConfig)
|
||||
|
||||
def nbStockfishRemotes = StockfishRemotes.size
|
||||
|
||||
private lazy val stockfishQueue = system.actorOf(Props(
|
||||
new stockfish.Queue(stockfishConfig, system)
|
||||
) withDispatcher StockfishQueueDispatcher, name = StockfishQueueName)
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
1500,
|
||||
"ease-in"
|
||||
);
|
||||
if (val > (this.threshold * this.maxVal)) {
|
||||
if (parseInt(val) + "" == "NaN" || val > (this.threshold * this.maxVal)) {
|
||||
this.elt.className = "monitor alert";
|
||||
} else {
|
||||
this.elt.className = "monitor";
|
||||
|
@ -151,25 +151,28 @@
|
|||
container : container
|
||||
});
|
||||
|
||||
app.ai = new SpeedOMeter({
|
||||
name : "AI LOAD",
|
||||
app.mps = new SpeedOMeter({
|
||||
name : "MOVES",
|
||||
maxVal : 100,
|
||||
threshold: 0.8,
|
||||
container : container
|
||||
});
|
||||
|
||||
app.ais = [];
|
||||
for (i=1;i<=nbAi;i++) {
|
||||
app.ais.push(new SpeedOMeter({
|
||||
name : "AI " + i + " LOAD",
|
||||
maxVal : 100,
|
||||
threshold: 0.8,
|
||||
container : container
|
||||
}));
|
||||
}
|
||||
|
||||
// app.lag = new SpeedOMeter({
|
||||
// name : "LAG",
|
||||
// maxVal : 200,
|
||||
// container : container
|
||||
// });
|
||||
|
||||
app.mps = new SpeedOMeter({
|
||||
name : "MOVES",
|
||||
maxVal : 100,
|
||||
container : container
|
||||
});
|
||||
|
||||
function setStatus(s) {
|
||||
window.document.body.className = s;
|
||||
}
|
||||
|
@ -188,6 +191,11 @@
|
|||
if (d.length == 2) {
|
||||
if (typeof app[d[1]] != "undefined") {
|
||||
app[d[1]].update(d[0]);
|
||||
} else if (d[1] == 'ai') {
|
||||
var ais = d[0].split(',');
|
||||
for (i=0;i<ais.length;i++) {
|
||||
app.ais[i].update(ais[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue