Instant and powerful insight into the live performance of your server side Swift applications.

  • close
  • minimize
  • expand
import SwiftMetrics
import SwiftMetricsDash

// Enable SwiftMetrics Monitoring
let sm = try SwiftMetrics()   

// Pass SwiftMetrics to the dashboard for visualising
let smd = try SwiftMetricsDash(swiftMetricsInstance : sm)  

Used by…

Microclimate

Microclimate is an end to end development environment that lets you rapidly create, edit, and deploy applications. Applications are run in containers from day one and can be delivered into production on Kubernetes through an automated DevOps pipeline using Jenkins. Microclimate can be installed locally or on IBM Cloud Private, and currently supports Java, Node, and Swift.

Development of Cloud-native Apps with Microclimate

Autoscaling Cloud applications on IBM Cloud

Automatically add or remove resources to match the current workload.

When traffic spikes, expand your cloud infrastructure footprint to keep your site running in the fast lane, and spin servers down when the rush subsides. Automatically. With Auto Scale, your environment grows or shrinks on demand to meet your needs in real time.

Identify usage-based or scheduled-based triggers for your cloud environment, and Auto Scale will do the heavy lifting. When one of those triggers is activated, we’ll add or remove the virtual servers you’ve designated. Only pay for the resources you need, when you need them.

getting started with the Auto-Scaling service…

Quick start guide

Adding SwiftMetrics monitoring to your application


Import SwiftMetrics modules in your app:

import SwiftMetrics
import SwiftMetricsDash

// Enable SwiftMetrics Monitoring
let sm = try SwiftMetrics()   

// Pass SwiftMetrics to the dashboard for visualising
let smd = try SwiftMetricsDash(swiftMetricsInstance : sm)  

Amend Package.swift to include the SwiftMetrics dependency:

On Swift 4:
   dependencies: [
      .package(url: "https://github.com/RuntimeTools/SwiftMetrics.git", from: "1.2.0")
      ]
   targets: [
      .target(name: "MyApp", dependencies: ["SwiftMetrics"], path: "Sources")]
      ]
On Swift 3.1:
   dependencies: [
      .Package(url: "https://github.com/RuntimeTools/SwiftMetrics.git", majorVersion: 1, minorVersion: 2)
      ]

By default, SwiftMetricsDash will starts its own Kitura server and serve the page up under <hostname>:<port>/swiftmetrics-dash

The port being used is logged to the console when your application starts:

    SwiftMetricsDash : Starting on port 8080

Resources