How to use __get_right_line method in yandex-tank

Best Python code snippet using yandex-tank

screen.py

Source:screen.py Github

copy

Full Screen

...63 block3 = VerticalBlock(block2, CurrentQuantilesBlock(self))64 block4 = VerticalBlock(block3, AnswSizesBlock(self))65 block5 = VerticalBlock(block4, AvgTimesBlock(self))66 self.block_rows = [[CurrentTimesDistBlock(self), block5]]67 def __get_right_line(self, widget_output):68 ''' Gets next line for right panel '''69 right_line = ''70 if widget_output:71 right_line = widget_output.pop(0)72 if len(right_line) > self.right_panel_width:73 right_line_plain = self.markup.clean_markup(right_line)74 if len(right_line_plain) > self.right_panel_width:75 right_line = right_line[:self.76 right_panel_width] + self.markup.RESET77 return right_line78 def __render_left_panel(self):79 ''' Render left blocks '''80 self.log.debug("Rendering left blocks")81 lines = []82 for row in self.block_rows:83 space_left = self.left_panel_width84 # render blocks85 for block in row:86 block.render()87 space_left -= block.width88 # merge blocks output into row89 space = ' ' * int(math.floor(float(space_left) / (len(row) + 1)))90 had_lines = True91 while had_lines:92 had_lines = False93 line = space94 for block in row:95 if block.lines:96 block_line = block.lines.pop(0)97 line += block_line + ' ' * (98 block.width -99 len(self.markup.clean_markup(block_line)))100 had_lines = True101 else:102 line += ' ' * block.width103 line += space104 lines.append(line)105 # lines.append(". " * (1 + self.left_panel_width / 3))106 # lines.append("")107 return lines108 def render_screen(self):109 ''' Main method to render screen view '''110 self.term_width, self.term_height = get_terminal_size()111 self.log.debug(112 "Terminal size: %sx%s", self.term_width, self.term_height)113 self.right_panel_width = int(114 (self.term_width - len(self.RIGHT_PANEL_SEPARATOR)) *115 (float(self.info_panel_percent) / 100)) - 1116 if self.right_panel_width > 0:117 self.left_panel_width = self.term_width - \118 self.right_panel_width - len(self.RIGHT_PANEL_SEPARATOR) - 2119 else:120 self.right_panel_width = 0121 self.left_panel_width = self.term_width - 1122 self.log.debug(123 "Left/right panels width: %s/%s", self.left_panel_width,124 self.right_panel_width)125 widget_output = []126 if self.right_panel_width:127 widget_output = []128 self.log.debug("There are %d info widgets" % len(self.info_widgets))129 for index, widget in sorted(130 self.info_widgets.iteritems(),131 key=lambda item: (item[1].get_index(), item[0])):132 self.log.debug("Rendering info widget #%s: %s", index, widget)133 widget_out = widget.render(self).strip()134 if widget_out:135 widget_output += widget_out.split("\n")136 widget_output += [""]137 left_lines = self.__render_left_panel()138 self.log.debug("Composing final screen output")139 output = []140 for line_no in range(1, self.term_height):141 line = " "142 if line_no > 1 and left_lines:143 left_line = left_lines.pop(0)144 left_line_plain = self.markup.clean_markup(left_line)145 if len(left_line) > self.left_panel_width:146 if len(left_line_plain) > self.left_panel_width:147 left_line = left_line[:self.148 left_panel_width] + self.markup.RESET149 left_line += (150 ' ' * (self.left_panel_width - len(left_line_plain)))151 line += left_line152 else:153 line += ' ' * self.left_panel_width154 if self.right_panel_width:155 line += self.markup.WHITE156 line += self.RIGHT_PANEL_SEPARATOR157 line += self.markup.RESET158 right_line = self.__get_right_line(widget_output)159 line += right_line160 output.append(line)161 return self.markup.new_line.join(output) + self.markup.new_line162 def add_info_widget(self, widget):163 '''164 Add widget string to right panel of the screen165 '''166 index = widget.get_index()167 while index in self.info_widgets.keys():168 index += 1169 self.info_widgets[widget.get_index()] = widget170 def add_second_data(self, data):171 '''172 Notification method about new aggregator data...

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run yandex-tank automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful