graphite-dev team mailing list archive
-
graphite-dev team
-
Mailing list archive
-
Message #03052
Re: [Question #205774]: exceptions.TypeError: must be encoded string without NULL bytes, not str
Question #205774 on Graphite changed:
https://answers.launchpad.net/graphite/+question/205774
Mike Wylie posted a new comment:
I had a look at the code in the exception trace and had a
though....would I be taking my life in my hands if I altered the file
/opt/graphite/lib/carbon/writer.py, to send the metric to the log file,
just before trying to look for its path? This may give me an idea what
it's failing to work with.
Would I need to restart something for the code to take affect?
I'm not a real python programmer, but I can understand the basics, I was
thinking something along the lines of:
def optimalWriteOrder():
"Generates metrics with the most cached values first and applies a soft rate limit on new metrics"
global lastCreateInterval
global createCount
metrics = MetricCache.counts()
t = time.time()
metrics.sort(key=lambda item: item[1], reverse=True) # by queue size, descending
log.msg("Sorted %d cache queues in %.6f seconds" % (len(metrics), time.time() - t))
for metric, queueSize in metrics:
if state.cacheTooFull and MetricCache.size < CACHE_SIZE_LOW_WATERMARK:
events.cacheSpaceAvailable()
# ------------------------------------------------
# my new piece of code
#
log.msg("reviewing metric:"+metric)
# ------------------------------------------------
dbFilePath = getFilesystemPath(metric)
dbFileExists = exists(dbFilePath)
--
You received this question notification because you are a member of
graphite-dev, which is an answer contact for Graphite.
Follow ups