blob: 7ebf9fb1c74a5a682eba5bf87724f63815e58bcb [file] [log] [blame]
Zeke Chind3325802015-08-14 11:00:02 -07001/*
2 * Copyright 2015 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
11#import "ARDStatsBuilder.h"
12
Mirko Bonadei19640aa2020-10-19 16:12:43 +020013#import "sdk/objc/api/peerconnection/RTCLegacyStatsReport.h"
14#import "sdk/objc/base/RTCMacros.h"
Zeke Chind3325802015-08-14 11:00:02 -070015
Zeke Chind3325802015-08-14 11:00:02 -070016#import "ARDUtilities.h"
17
Jaehyun Ko193f4bf2021-05-20 15:04:02 +090018@implementation ARDStatsBuilder
Zeke Chind3325802015-08-14 11:00:02 -070019
Jaehyun Ko193f4bf2021-05-20 15:04:02 +090020@synthesize stats = _stats;
Zeke Chind3325802015-08-14 11:00:02 -070021
22- (NSString *)statsString {
23 NSMutableString *result = [NSMutableString string];
Zeke Chind3325802015-08-14 11:00:02 -070024
Jaehyun Ko193f4bf2021-05-20 15:04:02 +090025 [result appendFormat:@"(cpu)%ld%%\n", (long)ARDGetCpuUsagePercentage()];
Zeke Chind3325802015-08-14 11:00:02 -070026
Jaehyun Ko193f4bf2021-05-20 15:04:02 +090027 for (NSString *key in _stats.statistics) {
28 RTC_OBJC_TYPE(RTCStatistics) *stat = _stats.statistics[key];
29 [result appendFormat:@"%@\n", stat.description];
30 }
Zeke Chind3325802015-08-14 11:00:02 -070031
32 return result;
33}
34
Zeke Chind3325802015-08-14 11:00:02 -070035@end
36