webrtc/examples/objc/AppRTCMobile/ARDStatsBuilder.m
Jaehyun Ko 193f4bf6c1 Replace legacy getStats with standard getStats in the iOS example
Bug: webrtc:12688
Change-Id: I039cdae7647738d5f17b229c1137b72bf4aa7be0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219580
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34063}
2021-05-20 08:40:11 +00:00

36 lines
978 B
Objective-C

/*
* Copyright 2015 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#import "ARDStatsBuilder.h"
#import "sdk/objc/api/peerconnection/RTCLegacyStatsReport.h"
#import "sdk/objc/base/RTCMacros.h"
#import "ARDUtilities.h"
@implementation ARDStatsBuilder
@synthesize stats = _stats;
- (NSString *)statsString {
NSMutableString *result = [NSMutableString string];
[result appendFormat:@"(cpu)%ld%%\n", (long)ARDGetCpuUsagePercentage()];
for (NSString *key in _stats.statistics) {
RTC_OBJC_TYPE(RTCStatistics) *stat = _stats.statistics[key];
[result appendFormat:@"%@\n", stat.description];
}
return result;
}
@end