-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RunLoopObservers added to RunLoop.main they observe the intervals between run loop activities and report long intervals.
- Loading branch information
Showing
30 changed files
with
1,361 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
Datadog/Example/Scenarios/RUM/MobileVitals/RUMMobileVitalsScenario.storyboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Y6W-OH-hqX"> | ||
<device id="retina6_1" orientation="portrait" appearance="light"/> | ||
<dependencies> | ||
<deployment identifier="iOS"/> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/> | ||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> | ||
<capability name="System colors in document resources" minToolsVersion="11.0"/> | ||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
</dependencies> | ||
<scenes> | ||
<!--Mobile Vitals View Controller--> | ||
<scene sceneID="s0d-6b-0kx"> | ||
<objects> | ||
<viewController id="Y6W-OH-hqX" customClass="RUMMobileVitalsViewController" customModule="Example" customModuleProvider="target" sceneMemberID="viewController"> | ||
<view key="view" contentMode="scaleToFill" id="5EZ-qb-Rvc"> | ||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<subviews> | ||
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="ca2-aW-xR8"> | ||
<rect key="frame" x="143" y="423" width="128" height="60"/> | ||
<subviews> | ||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="SSx-AL-9bb"> | ||
<rect key="frame" x="0.0" y="0.0" width="128" height="30"/> | ||
<state key="normal" title="No-op"/> | ||
<connections> | ||
<action selector="noOpButtonTapped:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="aqU-RG-zDa"/> | ||
</connections> | ||
</button> | ||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jCt-PH-psR"> | ||
<rect key="frame" x="0.0" y="30" width="128" height="30"/> | ||
<state key="normal" title="Block Main Thread"/> | ||
<connections> | ||
<action selector="blockMainThreadButtonTapped:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="CCI-ts-9al"/> | ||
</connections> | ||
</button> | ||
</subviews> | ||
</stackView> | ||
</subviews> | ||
<viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/> | ||
<color key="backgroundColor" systemColor="systemBackgroundColor"/> | ||
<constraints> | ||
<constraint firstItem="ca2-aW-xR8" firstAttribute="centerX" secondItem="vDu-zF-Fre" secondAttribute="centerX" id="WMO-TA-5tP"/> | ||
<constraint firstItem="ca2-aW-xR8" firstAttribute="centerY" secondItem="vDu-zF-Fre" secondAttribute="centerY" id="YHh-T6-UK3"/> | ||
</constraints> | ||
</view> | ||
</viewController> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="Ief-a0-LHa" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/> | ||
</objects> | ||
<point key="canvasLocation" x="28" y="75"/> | ||
</scene> | ||
</scenes> | ||
<resources> | ||
<systemColor name="systemBackgroundColor"> | ||
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> | ||
</systemColor> | ||
</resources> | ||
</document> |
28 changes: 28 additions & 0 deletions
28
Datadog/Example/Scenarios/RUM/MobileVitals/RUMMobileVitalsViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. | ||
* This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
* Copyright 2019-2020 Datadog, Inc. | ||
*/ | ||
|
||
import UIKit | ||
|
||
final class RUMMobileVitalsViewController: UIViewController { | ||
|
||
@IBAction func noOpButtonTapped(_ sender: Any) { | ||
print("No-op button tapped... Sending view update...") | ||
} | ||
|
||
@IBAction func blockMainThreadButtonTapped(_ sender: Any) { | ||
print("❌ Blocking main thread at \(Date())...") | ||
let startDate = Date() | ||
var i = 1 | ||
while true { | ||
i += 1 | ||
if Date().timeIntervalSince(startDate) > 3.0 { | ||
print("✅ Main thread is unblocked!") | ||
break | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.