MCPcopy Create free account
hub / github.com/kubernetes/test-infra / MeterFile

Class MeterFile

kettle/make_json.py:63–71  ·  view source on GitHub ↗

File-like object, throws away everything you write to it but keeps track of the size.

Source from the content-addressed store, hash-verified

61
62# https://stackoverflow.com/questions/39047624/is-there-an-easy-way-to-estimate-size-of-a-json-object
63class MeterFile:
64 """
65 File-like object, throws away everything you write to it but keeps track of the size.
66 """
67 def __init__(self, size=0):
68 self.size = size
69
70 def write(self, string):
71 self.size += len(string)
72
73class Build:
74 """

Callers 1

json_sizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected