Best Python code snippet using yandex-tank
decoder.py
Source:decoder.py  
...104                self.__make_points(105                    prefix + "proto_codes",106                    {"label": label},107                    ts,108                    self.__make_protocodes_fields(data)109                )110            )111        )112        # histograms, one row for each bin113        if self.histograms:114            for bin_, count in zip(data["interval_real"]["hist"]["bins"],115                                   data["interval_real"]["hist"]["data"]):116                label_points.append(117                    self.__make_points(118                        prefix + "histograms",119                        {"label": label},120                        ts,121                        {"bin": bin_, "count": count}122                    )123                )124        return label_points125    @staticmethod126    def __make_quantile_fields(data):127        return {128            'q' + str(q): value / 1000.0129            for q, value in zip(data["interval_real"]["q"]["q"],130                                data["interval_real"]["q"]["value"])131        }132    @staticmethod133    def __make_overall_meta_fields(data, stats):134        return {135            "active_threads": stats["metrics"]["instances"],136            "RPS": data["interval_real"]["len"],137            "planned_requests": float(stats["metrics"]["reqps"]),138        }139    @staticmethod140    def __make_netcodes_fields(data):141        return {142            str(code): int(cnt)143            for code, cnt in data["net_code"]["count"].items()144        }145    @staticmethod146    def __make_protocodes_fields(data):147        return {148            str(code): int(cnt)149            for code, cnt in data["proto_code"]["count"].items()150        }151    def __make_points(self, measurement, additional_tags, ts, fields):152        """153        Parameters154        ----------155        measurement : string156            measurement type (e.g. monitoring, overall_meta, net_codes, proto_codes, overall_quantiles)157        additional_tags : dict158            custom additional tags for this points159        ts : integer160            timestamp...Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
