Sha256: 2041d5f54618f8d931a1c886031442927196a06d35c5bea969800014baf9aa30

Contents?: true

Size: 508 Bytes

Versions: 10

Compression:

Stored size: 508 Bytes

Contents

import Foundation
import StatsD
import LoggerAPI

class Metrics {

  func setupStatsD() -> StatsD {
    return StatsD(
      host: config!["statsd"]["host"].stringValue,
      port: config!["statsd"]["port"].intValue,
      socket: UDPSocket(),
      interval: 1.0,
       sendCallback: { (success: Bool, error: SocketError?) in
         if success {
           Log.info("Sent data to StatsD")
         } else {
           Log.error("Failed to send data to StatsD \(error)")
         }
       }
    )
  }

}

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
minke-generator-swift-0.5 lib/generators/swift/scaffold/src/Sources/<%= application_name %>App/Metrics.swift
minke-generator-swift-0.4 lib/generators/swift/scaffold/src/Sources/<%= application_name %>App/Metrics.swift
minke-generator-swift-0.2.2 lib/generators/swift/scaffold/src/Sources/<%= application_name %>App/Metrics.swift
minke-generator-swift-0.2.1 lib/generators/swift/scaffold/src/Sources/<%= application_name %>App/Metrics.swift
minke-generator-swift-0.2.0 lib/generators/swift/scaffold/src/Sources/<%= application_name %>App/Metrics.swift
minke-generator-swift-0.1.8 lib/generators/swift/scaffold/src/Sources/<%= application_name %>App/Metrics.swift
minke-generator-swift-0.1.7 lib/generators/swift/scaffold/src/Sources/<%= application_name %>App/Metrics.swift
minke-generator-swift-0.1.6 lib/generators/swift/scaffold/src/Sources/<%= application_name %>App/Metrics.swift
minke-generator-swift-0.1.4 lib/generators/swift/scaffold/src/<%= application_name %>App/Metrics.swift
minke-generator-swift-0.1.0 lib/generators/swift/scaffold/src/<%= application_name %>App/Metrics.swift