# Faiyaz Ahmed <faiyaza@cs.princeton.edu>
# Copyright (C) 2004-2006 The Trustees of Princeton University
#
-# $Id$
-#
import syslog
import os
import time
# bwlimit exports a few useful functions like run(), get_xid(), and get_slice()
-import bwlimit
+import plnode.bwlimit as bwlimit
# Utility functions
from pl_mom import *
debug = False
verbose = 0
DATAFILE = "/var/lib/misc/swapmon.dat"
+# xxx fixme - this is broken under git
VERSION = "$Id$"
# Seconds between process analysis
period = 30
# Represent process as a dict of fields
values = line.split(None, len(fields) - 1)
if len(values) != len(fields):
- print "slicestat: failed to parse line: " + line
+ if "ERR" in line:
+ pass # ignore spurious error message from vps
+ else:
+ print "slicestat: failed to parse line: " + line
continue
proc = dict(zip(fields, values))
# cannot identify the context of an orphaned (usually dying)
# process. Skip these processes.
if (type(proc['xid']) != int) or (type(proc['vsize']) !=int):
- print "slicestat: failed to parse line: " + line
+ if "ERR" in line:
+ pass # ignore spurious error message from vps
+ else:
+ print "slicestat: failed to parse line: " + line
continue
# Assign (pl_)sshd processes to slice instead of root