OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_TOOLS_FLIP_SERVER_LOADTIME_MEASUREMENT_H__ | 5 #ifndef NET_TOOLS_FLIP_SERVER_LOADTIME_MEASUREMENT_H__ |
6 #define NET_TOOLS_FLIP_SERVER_LOADTIME_MEASUREMENT_H__ | 6 #define NET_TOOLS_FLIP_SERVER_LOADTIME_MEASUREMENT_H__ |
7 | 7 |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <fcntl.h> | 9 #include <fcntl.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 int num = atoi(action.substr(b + 1).c_str()); | 54 int num = atoi(action.substr(b + 1).c_str()); |
55 if (num < num_urls_) { | 55 if (num < num_urls_) { |
56 output.append(urls_[num]); | 56 output.append(urls_[num]); |
57 } | 57 } |
58 } | 58 } |
59 return; | 59 return; |
60 } | 60 } |
61 if (action.find("test_complete") == 0) { | 61 if (action.find("test_complete") == 0) { |
62 for (std::map<std::string, int>::const_iterator it = loadtimes_.begin(); | 62 for (std::map<std::string, int>::const_iterator it = loadtimes_.begin(); |
63 it != loadtimes_.end(); ++it) { | 63 it != loadtimes_.end(); ++it) { |
64 LOG(INFO) << it->first << " " << it->second; | 64 VLOG(0) << it->first << " " << it->second; |
65 } | 65 } |
66 loadtimes_.clear(); | 66 loadtimes_.clear(); |
67 output.append("OK"); | 67 output.append("OK"); |
68 return; | 68 return; |
69 } | 69 } |
70 if (action.find("record_page_load") == 0) { | 70 if (action.find("record_page_load") == 0) { |
71 std::vector<std::string> query; | 71 std::vector<std::string> query; |
72 split_string(action, '?', &query); | 72 split_string(action, '?', &query); |
73 std::vector<std::string> params; | 73 std::vector<std::string> params; |
74 split_string(query[1], '&', ¶ms); | 74 split_string(query[1], '&', ¶ms); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 } | 114 } |
115 | 115 |
116 int num_urls_; | 116 int num_urls_; |
117 std::vector<std::string> urls_; | 117 std::vector<std::string> urls_; |
118 std::map<std::string, int> loadtimes_; | 118 std::map<std::string, int> loadtimes_; |
119 const std::string pageload_html_file_; | 119 const std::string pageload_html_file_; |
120 }; | 120 }; |
121 | 121 |
122 #endif // NET_TOOLS_FLIP_SERVER_LOADTIME_MEASUREMENT_H__ | 122 #endif // NET_TOOLS_FLIP_SERVER_LOADTIME_MEASUREMENT_H__ |
123 | 123 |
OLD | NEW |