Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RUMM-1091 Harmonize code snippet in documentation #611

Merged
merged 2 commits into from
Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions docs/rum_collection/advanced_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ Example:
```swift
// in your `UIViewController`:

@IBAction func didTapDownloadResourceButton(_ sender: Any) {
@IBAction func didTapDownloadResourceButton(_ sender: UIButton) {
Global.rum.addUserAction(
type: .tap,
name: (sender as? UIButton).currentTitle ?? "",
name: sender.currentTitle ?? "",
)
}
```
Expand Down Expand Up @@ -214,6 +214,7 @@ Inside the `rumView(for:)` implementation, your app should decide if a given `UI
For instance, you can configure the predicate to use explicit type check for each view controller in your app:
```swift
class YourCustomPredicate: UIKitRUMViewsPredicate {

func rumView(for viewController: UIViewController) -> RUMView? {
switch viewController {
case is HomeViewController: return .init(name: "Home")
Expand All @@ -227,12 +228,13 @@ class YourCustomPredicate: UIKitRUMViewsPredicate {
You can even come up with a more dynamic solution depending on your app's architecture. For example, if your view controllers use `accessibilityLabel` consistently, you can name views by the value of accessibility label:
```swift
class YourCustomPredicate: UIKitRUMViewsPredicate {

func rumView(for viewController: UIViewController) -> RUMView? {
if let accessibilityLabel = viewController.accessibilityLabel {
return .init(name: accessibilityLabel)
} else {
guard let accessibilityLabel = viewController.accessibilityLabel else {
return nil
}

return RUMView(name: accessibilityLabel)
}
}
```
Expand Down
4 changes: 2 additions & 2 deletions docs/rum_collection/data_collected.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ You can enable [tracking user info][2] globally to collect and apply user attrib

| Attribute name | Type | Description |
|----------------|--------|-------------------------|
| `user.id` | string | Identifier of the user. |
| `usr.id` | string | Identifier of the user. |
| `usr.name` | string | Name of the user. |
| `usr.email` | string | Email of the user. |

Expand Down Expand Up @@ -152,7 +152,7 @@ RUM action, error, resource and long task events contain information about the a

| Metric | Type | Description |
|--------------------------------|----------------|-------------------------------------------------------------------------------------------------|
| `duration` | number | Entire time spent loading the resource. |
| `resource.duration` | number | Entire time spent loading the resource. |
| `resource.size` | number (bytes) | Resource size. |
| `resource.connect.duration` | number (ns) | Time spent establishing a connection to the server (connectEnd - connectStart) |
| `resource.ssl.duration` | number (ns) | Time spent for the TLS handshake. |
Expand Down