Module ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias TryExcept body ImportFrom alias handlers ExceptHandler type NameLoad body ImportFrom alias ImportFrom alias ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults NameLoad body If UnaryOpNot NameLoad body Assign NameStore ListLoad Assign NameStore Call NameLoad Str Dict Str Str NameLoad Num Assign AttributeStore NameLoad attr Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr ListLoad Str Assign AttributeStore NameLoad attr Call NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str decorator_list Call NameLoad Str Call NameLoad keyword NameLoad Call NameLoad Str Call NameLoad Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr ListLoad Str Expr Call AttributeLoad NameLoad attr ListLoad Str Str Assign AttributeStore NameLoad attr Call NameLoad Call AttributeLoad Str attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad Dict Assign AttributeStore NameLoad attr Call NameLoad Call AttributeLoad Str attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Num Assign NameStore Dict Str Str Num Num Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list Call NameLoad Str Call NameLoad keyword NameLoad Call NameLoad Str Call NameLoad Str FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr ListLoad Str Str Str Str Assign AttributeStore NameLoad attr ListLoad Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad Dict Assign AttributeStore NameLoad attr ListLoad Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Dict Str Str Str Str Num Num Num Num Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list Call NameLoad Str FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr ListLoad Assign AttributeStore NameLoad attr ListLoad Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad Dict Assign AttributeStore NameLoad attr ListLoad Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Dict Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Expr Call AttributeLoad NameLoad attr keyword AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword NameLoad keyword SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list Call NameLoad Str decorator_list If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr
N/A test CollectorTestCase test get_collector_config test unittest mock Mock mock patch N/A N/A cStringIO StringIO N/A N/A N/A ImportError N/A StringIO StringIO tcp TCPCollector TestTCPCollector N/A CollectorTestCase N/A setUp N/A N/A self allowed_names N/A None N/A N/A N/A allowed_names N/A N/A allowed_names N/A N/A config N/A get_collector_config TCPCollector N/A allowed_names interval allowed_names 1 N/A N/A self collector N/A TCPCollector config None N/A test_import N/A N/A self N/A N/A N/A N/A N/A self assertTrue TCPCollector N/A test_should_open_proc_net_netstat N/A N/A self publish_mock open_mock N/A N/A N/A N/A TCPCollector PROC N/A /proc/net/netstat N/A N/A open_mock return_value N/A StringIO N/A N/A N/A N/A self collector collect N/A N/A N/A open_mock assert_called_once_with /proc/net/netstat N/A N/A patch os.access N/A Mock return_value True N/A patch __builtin__.open N/A patch diamond.collector.Collector.publish test_should_work_with_synthetic_data N/A N/A self publish_mock open_mock N/A N/A N/A N/A TCPCollector PROC N/A /proc/net/netstat N/A N/A N/A self setUp N/A A C N/A N/A open_mock return_value N/A StringIO N/A N/A 
TcpExt: A B C
TcpExt: 0 0 0
 strip N/A N/A N/A N/A self collector collect N/A N/A N/A self assertPublishedMany publish_mock N/A N/A N/A open_mock return_value N/A StringIO N/A N/A 
TcpExt: A B C
TcpExt: 0 1 2
 strip N/A N/A N/A N/A self collector collect N/A N/A N/A self assertEqual N/A len N/A publish_mock call_args_list 2 N/A metrics N/A A C 0 2 N/A N/A N/A self assertPublishedMany publish_mock metrics N/A N/A patch os.access N/A Mock return_value True N/A patch __builtin__.open N/A patch diamond.collector.Collector.publish test_should_work_with_real_data N/A N/A self publish_mock N/A N/A N/A N/A N/A self setUp N/A ListenOverflows ListenDrops TCPLoss TCPTimeouts N/A N/A TCPCollector PROC N/A N/A N/A self getFixturePath proc_net_netstat_1 N/A N/A N/A N/A self collector collect N/A N/A N/A self assertPublishedMany publish_mock N/A N/A N/A TCPCollector PROC N/A N/A N/A self getFixturePath proc_net_netstat_2 N/A N/A N/A N/A self collector collect N/A metrics N/A ListenOverflows ListenDrops TCPLoss TCPTimeouts 0 0 188 15265 N/A N/A N/A self assertPublishedMany publish_mock metrics N/A N/A patch diamond.collector.Collector.publish test_should_work_with_all_data N/A N/A self publish_mock N/A N/A N/A N/A N/A self setUp N/A N/A N/A TCPCollector PROC N/A N/A N/A self getFixturePath proc_net_netstat_1 N/A N/A self getFixturePath proc_net_snmp_1 N/A N/A N/A N/A self collector collect N/A N/A N/A self assertPublishedMany publish_mock N/A N/A N/A TCPCollector PROC N/A N/A N/A self getFixturePath proc_net_netstat_2 N/A N/A self getFixturePath proc_net_snmp_2 N/A N/A N/A N/A self collector collect N/A metrics N/A TCPMD5Unexpected ArpFilter TCPBacklogDrop TCPDSACKRecv TCPDSACKIgnoredOld MaxConn RcvPruned TCPSackMerged OutOfWindowIcmps TCPDeferAcceptDrop TCPLossUndo TCPHPHitsToUser TCPTimeouts TCPForwardRetrans TCPTSReorder RtoMin TCPAbortOnData TCPFullUndo TCPSackRecoveryFail InErrs TCPAbortOnClose TCPAbortOnTimeout TCPFACKReorder LockDroppedIcmps RtoMax TCPSchedulerFailed EstabResets DelayedACKs TCPSACKReneging PruneCalled OutRsts TCPRenoRecoveryFail TCPSackShifted DelayedACKLocked TCPHPHits EmbryonicRsts TCPLossFailures TWKilled TCPSACKDiscard TCPAbortFailed TCPSackRecovery TCPDirectCopyFromBacklog TCPFastRetrans TCPPartialUndo TCPMinTTLDrop SyncookiesSent OutSegs TCPSackShiftFallback RetransSegs IPReversePathFilter TCPRcvCollapsed TCPDSACKUndo SyncookiesFailed TCPSACKReorder TCPDSACKOldSent TCPAbortOnLinger TCPSpuriousRTOs TCPRenoRecovery TCPPrequeued TCPLostRetransmit TCPLoss TCPHPAcks TCPDSACKOfoRecv TWRecycled TCPRenoFailures OfoPruned TCPMD5NotFound ActiveOpens TCPDSACKIgnoredNoUndo TCPPrequeueDropped RtoAlgorithm TCPAbortOnMemory TCPTimeWaitOverflow TCPAbortOnSyn TCPDirectCopyFromPrequeue DelayedACKLost PassiveOpens InSegs PAWSPassive TCPRenoReorder CurrEstab TW AttemptFails PAWSActive ListenDrops SyncookiesRecv TCPDSACKOfoSent TCPSlowStartRetrans TCPMemoryPressures PAWSEstab TCPSackFailures ListenOverflows TCPPureAcks 0.0 0.0 0.0 1580.0 292.0 -1.0 0.0 1121.0 10.0 0.0 6538.0 5667.0 15265.0 41.0 0.0 0.0 143.0 0.0 13.0 0.0 38916.0 68.0 0.0 4.0 0.0 0.0 0.0 125491.0 0.0 0.0 0.0 0.0 2356.0 144.0 10361792.0 0.0 7.0 0.0 0.0 0.0 364.0 35660.0 1184.0 0.0 0.0 0.0 0.0 3091.0 0.0 0.0 0.0 2448.0 9.0 0.0 10175.0 0.0 9.0 0.0 114232.0 7.0 188.0 12673896.0 0.0 0.0 0.0 0.0 0.0 0.0 1025.0 0.0 0.0 0.0 0.0 0.0 19340531.0 10118.0 0.0 1.0 0.0 0.0 3.0 89479.0 0.0 0.0 0.0 0.0 0.0 2540.0 0.0 0.0 502.0 0.0 1003528.0 N/A N/A N/A self setDocExample collector N/A N/A N/A self collector __class__ __name__ metrics metrics defaultpath N/A N/A N/A self collector config N/A path N/A N/A N/A self assertPublishedMany publish_mock metrics N/A N/A patch diamond.collector.Collector.publish N/A N/A N/A __name__ __main__ N/A N/A N/A N/A unittest main