IBM/metrics-collector-client-swift

Name: metrics-collector-client-swift

Owner: International Business Machines

Description: Swift client for the Deployment Tracker

Forked from: IBM-Cloud/cf-deployment-tracker-client-swift

Created: 2017-10-02 23:16:46.0

Updated: 2018-01-22 18:49:17.0

Pushed: 2017-12-20 19:03:03.0

Homepage: null

Size: 140

Language: Swift

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build Status Platform

Overview

Metrics Collector Service collects statistics for deployment of a github sample code on Cloud Foundry, Kubernetes, Data Science Experience, OpenWhisk etc.

The MetricsTrackerClient for Swift is a package used to track number of deployments for a particular Swift project. This Swift package requires little setup and allows IBMers to view deployment stats on the Deployment Tracker, for their demo/tutorial projects. If you'd like, you can include a deployment count badge in your project's README:

Deployment badge example

Swift version support

You can download different versions of the Swift binaries by following this link.

To Use
  1. To leverage the MetricsTrackerClient package in your Swift application, you should specify a dependency for it in your Package.swift file:

    ort PackageDescription
    
     package = Package(
     name: "MyAwesomeSwiftProject",
    
     ...
    
     dependencies: [
    
        // Swift 3.1.1
         .Package(url: "https://github.com/IBM/metrics-tracker-client-swift.git", majorVersion: 5),
    
     // Swift 4.0
    .package(url: "https://github.com/IBM/metrics-tracker-client-swift.git", .upToNextMajor(from: "5.0.0")),
         ...
    
     ])
    
  2. Once the Package.swift file of your application has been updated accordingly, you can import the MetricsTrackerClient module in your code. Additionally, you will need to initialize the MetricsTrackerClient and call the track() method, as seen here:

    rt MetricsTrackerClient
    
    
    
    icsTrackerClient(repository: "BluePic", organization: "IBM").track()
    

    Note: You must replace BluePic with your own Github repository name. If your repository is not in IBM, please also replaces IBM with your repository's organization.

The above code should be used within the main entry point of your Swift application, generally before you start your server.

  1. Add a repository.yaml file in your GitHub master's top level repository.

  2. Lastly, you should add a copy of the Privacy Notice to the README of your project. All applications that use the deployment tracker must have a Privacy Notice.

Example repository.yaml file

The repository.yaml need to be written in Yaml format. Also, please put all your keys in lower case.

https://github.com/IBM/BluePic
imes: 
Cloud Foundry
ices: 
Discovery
t_id: web
t_organizer: dev-journeys
uage: swift

Required field:

  1. id: Put your Github URL of your pattern/project.
  2. Note: Please put down the Github URL if your pattern is not from IBM organization in Github.
  3. runtimes: Put down all your platform runtime environments in a list.
  4. services: Put down all the IBM Cloud services that are used in your journey in a list.
  5. event_id: Put down where you will distribute your application. Default is web.
  6. event_organizer: Put down your event organizer if you have one. Default is dev-journeys
  7. language: If your application is not in swift, please put down the application's main language in lower case.

List of runtimes, services, and languages

Please go to the service list page to get the list of official names for runtimes, services, and languages.

Example App

To see how to include this package into your app, please visit BluePic. View the Package.swift and main.swift as a reference.

Privacy Notice
rivacy Notice
 Swift application includes code to track deployments to [IBM Cloud](https://www.bluemix.net/) and other Cloud Foundry platforms. The following information is sent to a [Deployment Tracker](https://github.com/IBM/metrics-collector-service) service on each deployment:

ift project code version (if provided)
ift project repository URL
plication Name (`application_name`)
ace ID (`space_id`)
plication Version (`application_version`)
plication URIs (`application_uris`)
bels and names of bound services
mber of instances for each bound service and associated plan information
tadata in the repository.yaml file

 data is collected from the parameters of the `MetricsTrackerClient`, the `VCAP_APPLICATION` and `VCAP_SERVICES` environment variables in IBM Cloud and other Cloud Foundry platforms. This data is used by IBM to track metrics around deployments of sample applications to IBM Cloud to measure the usefulness of our examples, so that we can continuously improve the content we offer to you. Only deployments of sample applications that include code to ping the Deployment Tracker service will be tracked.

Disabling Deployment Tracking
se see the README for the sample application that includes this package for instructions on disabling deployment tracking, as the instructions may vary based on the sample application in which this package is included.
License

This Swift package is licensed under Apache 2.0. Full license text is available in LICENSE.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.