-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from lsst-sqre/tickets/DM-31998
DM-31998: Performance tuning
- Loading branch information
Showing
5 changed files
with
69 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ metadata: | |
labels: | ||
app: rubintv | ||
spec: | ||
replicas: 1 | ||
replicas: 5 | ||
selector: | ||
matchLabels: | ||
name: rubintv | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
$(document).ready(function(){ | ||
refreshDiv(); | ||
}); | ||
$(document).ready(function () { | ||
refreshDiv(); | ||
}); | ||
|
||
function refreshDiv(){ | ||
$('#refresher').load(window.location.href + " #refresher" , function(){ | ||
setTimeout(refreshDiv, 500); | ||
}); | ||
} | ||
function refreshDiv() { | ||
$('#refresher').load(window.location.href + ' #refresher', function () { | ||
setTimeout(refreshDiv, 5000); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"""Basic timing utility.""" | ||
|
||
from __future__ import annotations | ||
|
||
import time | ||
from typing import Any | ||
|
||
__all__ = ["Timer"] | ||
|
||
|
||
class Timer: | ||
"""Time a context. | ||
Access the duration after the context exits with the ``seconds`` | ||
attribute. | ||
""" | ||
|
||
def __enter__(self) -> Timer: | ||
self._start = time.perf_counter() | ||
return self | ||
|
||
def __exit__(self, *exc_info: Any) -> None: | ||
self.seconds = time.perf_counter() - self._start |