mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-16 21:23:52 +01:00
don't need the resource portion
This commit is contained in:
parent
02c1d29133
commit
c60e0d5e02
1 changed files with 0 additions and 23 deletions
|
@ -13,27 +13,4 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from twisted.web.resource import Resource
|
|
||||||
|
|
||||||
import synapse.metrics
|
|
||||||
|
|
||||||
|
|
||||||
METRICS_PREFIX = "/_synapse/metrics"
|
METRICS_PREFIX = "/_synapse/metrics"
|
||||||
|
|
||||||
|
|
||||||
class MetricsResource(Resource):
|
|
||||||
isLeaf = True
|
|
||||||
|
|
||||||
def __init__(self, hs):
|
|
||||||
Resource.__init__(self) # Resource is old-style, so no super()
|
|
||||||
|
|
||||||
self.hs = hs
|
|
||||||
|
|
||||||
def render_GET(self, request):
|
|
||||||
response = synapse.metrics.render_all()
|
|
||||||
|
|
||||||
request.setHeader("Content-Type", "text/plain")
|
|
||||||
request.setHeader("Content-Length", str(len(response)))
|
|
||||||
|
|
||||||
# Encode as UTF-8 (default)
|
|
||||||
return response.encode()
|
|
||||||
|
|
Loading…
Reference in a new issue