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
155 stars 49 forks source link

Remove SwiftyJSON #164

Closed ianpartridge closed 5 years ago

ianpartridge commented 6 years ago

From the output of swift package show-dependencies:

├── SwiftMetrics<https://github.com/RuntimeTools/SwiftMetrics.git@2.0.0>
│   ├── omr-agentcore<https://github.com/RuntimeTools/omr-agentcore@3.2.4-swift4>
│   ├── Kitura<https://github.com/IBM-Swift/Kitura.git@2.0.0>
│   │   ├── Kitura-net<https://github.com/IBM-Swift/Kitura-net.git@1.7.18>
│   │   │   ├── LoggerAPI<https://github.com/IBM-Swift/LoggerAPI.git@1.7.1>
│   │   │   ├── Socket<https://github.com/IBM-Swift/BlueSocket.git@0.12.76>
│   │   │   ├── CCurl<https://github.com/IBM-Swift/CCurl.git@0.4.1>
│   │   │   └── SSLService<https://github.com/IBM-Swift/BlueSSLService.git@0.12.64>
│   │   │       └── Socket<https://github.com/IBM-Swift/BlueSocket.git@0.12.76>
│   │   ├── Kitura-TemplateEngine<https://github.com/IBM-Swift/Kitura-TemplateEngine.git@1.7.2>
│   │   └── KituraContracts<https://github.com/IBM-Swift/KituraContracts.git@0.0.14>
│   ├── Kitura-WebSocket<https://github.com/IBM-Swift/Kitura-WebSocket.git@0.9.1>
│   │   ├── Kitura-net<https://github.com/IBM-Swift/Kitura-net.git@1.7.18>
│   │   │   ├── LoggerAPI<https://github.com/IBM-Swift/LoggerAPI.git@1.7.1>
│   │   │   ├── Socket<https://github.com/IBM-Swift/BlueSocket.git@0.12.76>
│   │   │   ├── CCurl<https://github.com/IBM-Swift/CCurl.git@0.4.1>
│   │   │   └── SSLService<https://github.com/IBM-Swift/BlueSSLService.git@0.12.64>
│   │   │       └── Socket<https://github.com/IBM-Swift/BlueSocket.git@0.12.76>
│   │   └── Cryptor<https://github.com/IBM-Swift/BlueCryptor.git@0.8.18>
│   │       └── CommonCrypto<https://github.com/IBM-Swift/CommonCrypto.git@0.1.5>
│   ├── KituraRequest<https://github.com/IBM-Swift/Kitura-Request.git@0.8.2>
│   │   └── Kitura-net<https://github.com/IBM-Swift/Kitura-net.git@1.7.18>
│   │       ├── LoggerAPI<https://github.com/IBM-Swift/LoggerAPI.git@1.7.1>
│   │       ├── Socket<https://github.com/IBM-Swift/BlueSocket.git@0.12.76>
│   │       ├── CCurl<https://github.com/IBM-Swift/CCurl.git@0.4.1>
│   │       └── SSLService<https://github.com/IBM-Swift/BlueSSLService.git@0.12.64>
│   │           └── Socket<https://github.com/IBM-Swift/BlueSocket.git@0.12.76>
│   ├── CloudFoundryEnv<https://github.com/IBM-Swift/Swift-cfenv.git@4.1.0>
│   │   ├── LoggerAPI<https://github.com/IBM-Swift/LoggerAPI.git@1.7.1>
│   │   └── Configuration<https://github.com/IBM-Swift/Configuration.git@1.0.4>
│   │       └── LoggerAPI<https://github.com/IBM-Swift/LoggerAPI.git@1.7.1>
│   └── SwiftyJSON<https://github.com/IBM-Swift/SwiftyJSON.git@17.0.0>

We have eradicated SwiftyJSON from Kitura as the new Codable features in Swift 4 render it obsolete. We should remove it from SwiftMetrics too as it gets pulled in by every scaffolded project.

sjanuary commented 6 years ago

156 addresses half of this, but the other half is still TBD.

ianpartridge commented 6 years ago

As SwiftyJSON is now a known cause of bugs (cf #185) please can we prioritise this work?

sjanuary commented 6 years ago

@ianpartridge we managed 50% of this, unfortunately we still have the dependency in SwiftMetricsBluemix for now.

ianpartridge commented 6 years ago

Is it just this function that needs reworking? https://github.com/RuntimeTools/SwiftMetrics/blob/master/Sources/SwiftMetricsBluemix/SwiftMetricsBluemix.swift#L445

sjanuary commented 6 years ago

Yes, I briefly looked at doing it with Codable but I ran out of time. We also don't have full details of the object that we're receiving from Bluemix which makes things tricky.

ianpartridge commented 6 years ago

The object comes from the auto-scaling service doesn't it? Do they not document a schema or something?

sjanuary commented 6 years ago

Not for the REST call that we use, it's not part of the public API - https://console.bluemix.net/apidocs/48-auto-scaling?&language=node#introduction

ianpartridge commented 5 years ago

Fixed in https://github.com/RuntimeTools/SwiftMetrics/commit/2d76575bf9b239a949aaf418aaba869be863a181