libobserve Package

obs Module

class cbtestlib.perf_engines.libobserve.obs.Observable(key='', cas=0, start_time=0, persist_count=1, repl_count=1)
remove_server(server, repl=False, stats=True)

remove server from checklist, decrement counter and record finish time if necessary

class cbtestlib.perf_engines.libobserve.obs.Observer
clear_observables()
load_observables(observables)

Load observables into cache for observation. @param observables must be a iterable collections of Observable

num_observables()
observable_filter(status)

Generate observables, using status as filter not thread safe.

observe(blocking=True)
reskey_generator(responses)
update_observables(responses)

Update observables based on (@param: responses), using key_state as filter

obs_def Module

class cbtestlib.perf_engines.libobserve.obs_def.ObserveKeyState
OBS_FOUND = 0
OBS_IMPOSSIBLE = 129
OBS_NOT_FOUND = 128
OBS_PERSISITED = 1
class cbtestlib.perf_engines.libobserve.obs_def.ObservePktFmt
OBS_REQ_BODY_FMT = '!HH'
OBS_REQ_HDR_FMT = '>BBHBBHIIQ'
OBS_RES_BODY_FMT = '!HH'
OBS_RES_BODY_LEN = 4
OBS_RES_HDR_FMT = '!BBHBBHIIII'
OBS_RES_HDR_LEN = 24
class cbtestlib.perf_engines.libobserve.obs_def.ObserveStatus
OBS_ERROR = 238
OBS_MODIFIED = 1
OBS_SUCCESS = 0
OBS_TIMEDOUT = 2
OBS_UNKNOWN = 255

obs_helper Module

class cbtestlib.perf_engines.libobserve.obs_helper.SyncDict

Synchronized dict wrapper with basic atomic operations.

clear()
empty()
get(key)
pop(key)
put(key, value)
remove(key)
size()
wait_not_empty()

Wait until an item becomes available.

@caution: Not a traditional pro/con call.
To minimize locking scope, items won’t be consumed here.
class cbtestlib.perf_engines.libobserve.obs_helper.UnblockingJoinableQueue(maxsize=0)

Bases: multiprocessing.queues.JoinableQueue

A joinable queue with methods for unblocking events.

all_finished()

Check if all tasks have finished

class cbtestlib.perf_engines.libobserve.obs_helper.VbucketHelper
static get_vbucket_id(key, num_vbuckets)

obs_mcsoda Module

class cbtestlib.perf_engines.libobserve.obs_mcsoda.McsodaObserver(ctl, cfg, store, callback)

Bases: cbtestlib.perf_engines.libobserve.obs.Observer, threading.Thread

awareness = None
block_for_persistence(key, cas, timeout=0)

observe a key until it has been persisted

callback = None
cfg = None
conns = {}
ctl = None
measure_client_latency()
obs_keys = {}
observe_single(key, timeout=0)

send an observe command and get the response back

run()
save_latency_stats(latency, time=0, server=True, repl=False)
store = None

obs_req Module

class cbtestlib.perf_engines.libobserve.obs_req.ObserveRequest(keys, opaque=0, cas=0)
body_len = 0
cas = 0
data_type = 0
extra_len = 0
key_len = 0
keys = []
magic = 128
opaque = 0
opcode = 146
pack()
vbucket = 0
class cbtestlib.perf_engines.libobserve.obs_req.ObserveRequestKey(key, vbucket)
key = ''
key_len = 0
pack()
vbucket = 0

obs_res Module

class cbtestlib.perf_engines.libobserve.obs_res.ObserveResponse
unpack_body(body)
unpack_hdr(hdr)
class cbtestlib.perf_engines.libobserve.obs_res.ObserveResponseKey(key, vbucket=0, key_state=129, cas=0)

Table Of Contents

Previous topic

perf_engines Package

Next topic

libstats Package

This Page