RuntimeTools / SwiftMetrics

Swift Application Metrics instruments the Swift runtime for performance monitoring, providing the monitoring data programatically via an API or visually with an Eclipse Client.
https://developer.ibm.com/swift/monitoring-diagnostics/application-metrics-for-swift/
Other
154 stars 49 forks source link

Error message in debug area when running Kitura app from Xcode #181

Closed jorgealegre closed 6 years ago

jorgealegre commented 6 years ago

When creating a new Kitura app from the Kitura CLI (kitura init) an app with a dependency for this project is created. If this app is run from Xcode with Command+R, the following message (among other initialization messages) appears in the Xcode debug area:

SwiftMetrics: Error finding .build directory
SwiftMetrics: Error finding directory containing source code in

However, accessing routes /metrics and /swiftmetrics-dash works and each show useful information.

If the app is run from the CLI with ./.build/debug/{appName}, the message disappears.

Environment information:

let package = Package( name: "jenkinsBot", dependencies: [ .package(url: "https://github.com/IBM-Swift/Kitura.git", .upToNextMinor(from: "2.0.0")), .package(url: "https://github.com/IBM-Swift/HeliumLogger.git", .upToNextMinor(from: "1.7.1")), .package(url: "https://github.com/IBM-Swift/CloudEnvironment.git", from: "6.0.0"), .package(url: "https://github.com/IBM-Swift/Configuration.git", from: "3.0.0"), .package(url: "https://github.com/RuntimeTools/SwiftMetrics.git", from: "2.0.0"), .package(url: "https://github.com/IBM-Swift/Health.git", from: "0.0.0"), .package(url: "https://github.com/IBM-Swift/Kitura-redis.git", .upToNextMinor(from: "1.7.0")), ], targets: [ .target(name: "jenkinsBot", dependencies: [ .target(name: "Application"), "Kitura" , "HeliumLogger"]), .target(name: "Application", dependencies: ["Kitura", "Configuration", "CloudEnvironment", "SwiftMetrics", "Health", "SwiftRedis"]), .testTarget(name: "ApplicationTests", dependencies: [.target(name: "Application"), "Kitura", "HeliumLogger"]) ] )


- Swift: 4.0.3 (swiftlang-900.0.74.1 clang-900.0.39.2)
neurosaurus commented 6 years ago

I'm having the same issue as above with Apple Swift version 4.1.2 (swiftlang-902.0.54 clang-902.0.39.2).

neurosaurus commented 6 years ago

To add on, this issue is crashing Xcode as well.

sjanuary commented 6 years ago

There are two issues here. Firstly SwiftMetrics writes out error messages unnecessarily, we should put out info instead or just remove them. Secondly there's a major issue on 4.1.2, see also #185. We're working on this as a priority but until that is fixed please use 4.0 instead.

sjanuary commented 6 years ago

Fixed and now published in SwiftMetrics 2.4.0