Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(464)

Side by Side Diff: webrtc/tools/network_tester/create_network_tester_config.py

Issue 2779233002: Add first part of the network_tester functionality. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
3 #
4 # Use of this source code is governed by a BSD-style license
5 # that can be found in the LICENSE file in the root of the source
6 # tree. An additional intellectual property rights grant can be found
7 # in the file PATENTS. All contributing project authors may
8 # be found in the AUTHORS file in the root of the source tree.
9
10 import network_tester_config_pb2
11
12 def CreateTesterConfig(packet_send_interval_ms, packet_size, execution_time_ms):
13 config = network_tester_config_pb2.NetworkTesterConfig()
14 config.packet_send_interval_ms = packet_send_interval_ms
15 config.packet_size = packet_size
16 config.execution_time_ms = execution_time_ms
17 return config
18
19 network_configs = []
20
21 network_configs.append(CreateTesterConfig(10, 50 , 200))
22 network_configs.append(CreateTesterConfig(10, 100 , 200))
stefan-webrtc 2017/03/30 07:56:53 Remove space after 100: "100 ," Same for "50 ,"
michaelt 2017/03/30 08:29:26 Done.
23
24 with open("network_tester_config.dat",'wb') as f:
25 for config in network_configs:
26 f.write(chr(config.ByteSize()))
27 f.write(config.SerializeToString())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698