<s> import socket <EOL> from time import time <EOL> class Galena ( object ) : <EOL> def __init__ ( self , host = "<STR_LIT:localhost>" , port = <NUM_LIT> ) : <EOL> self . _addr = ( host , port ) <EOL> self . _sock = socket . socket ( socket . AF_INET , socket . SOCK_STREAM ) <EOL> self . _sock . connect ( self . _addr ) <EOL> def send ( self , metric , value , timestamp = None ) : <EOL> try : <EOL> self . _sock . send ( "<STR_LIT>" % ( metric , value , <EOL> timestamp or int ( time ( ) ) ) ) <EOL> except socket . error : <EOL> pass </s>
