def circuit_built(self, circuit):
        """ICircuitListener API"""
        # older tor versions will have empty build_flags
        if 'ONEHOP_TUNNEL' in circuit.build_flags:
            return

        if circuit.purpose == 'GENERAL':
            if len(circuit.path) > 0:
                if circuit.path[0] not in self.state.entry_guards.values():
                    print "WEIRD: first circuit hop not in entry guards:",
                    print circuit, circuit.path, circuit.purpose
                    return

            self.built_circuits += 1
            self.update_percent()

            if len(circuit.path) != 3 and len(circuit.path) != 4:
                print "WEIRD: circuit has odd pathlength:",
                print circuit, circuit.path
            try:
                self.per_guard_built[circuit.path[0].unique_name] += 1.0
            except __HOLE__:
                self.per_guard_built[circuit.path[0].unique_name] = 1.0
                self.per_guard_failed[circuit.path[0].unique_name] = 0.0
dataset/ETHPy150Open meejah/txtorcon/examples/circuit_failure_rates.py/CircuitFailureWatcher.circuit_built