librato 0.1.0

  • README.md
  • changelog.md
  • Example
  • Installing
  • Versions
  • 0

librato

Build Status

A Dart library to upload metrics data to librato.com.

Usage

To use this library, instantiate an instance of the Librato class and call its postStats method to post a set of statistics.

You need to provide a Librato username and access token, either explicitly in the constructor, or implicitly via environment variables (LIBRATO_USER and LIBRATO_TOKEN).

Librato librato = new Librato.fromEnvVars();
List<LibratoStat> stats = [
  new LibratoStat('benchmarkTime', 130);
  new LibratoStat('compiledAppSize', 230000);
];
librato.postStats(stats);

Features and bugs

Please file feature requests and bugs at the issue tracker.

Notes

This is not an official Google project.

Changelog

0.1.0

  • use BASE64 from dart:convert

0.0.1

  • Initial version, created by Stagehand

example/example.dart

// Copyright (c) 2015, Google Inc. Please see the AUTHORS file for details.
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

library librato.example;

import 'dart:math' as math;

import 'package:librato/librato.dart';

void main(List<String> args) {
  if (args.length == 3) {
    Librato librato = new Librato(args[0], args[1]);

    // Post a stat.
    LibratoStat stat = new LibratoStat('startupTime', num.parse(args[2]));
    librato.postStats([stat]).then((_) {
      print('Sent ${stat}');
    });

    // Post an annotation.
    String commit = new math.Random().nextInt(0x7fffffff).toRadixString(16);
    LibratoLink link = new LibratoLink(
        'github', 'https://github.com/foo/bar/commit/${commit}');
    LibratoAnnotation annotation = new LibratoAnnotation(commit,
        description: 'Build triggered from commit ${commit}', links: [link]);
    librato.createAnnotation('builds', annotation).then((_) {
      print('Sent ${annotation}');
    });
  } else {
    print('usage: librato <username> <token> <stat-to-record>');
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  librato: ^0.1.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:librato/librato.dart';
  
Version Uploaded Documentation Archive
0.1.0 May 12, 2017 Go to the documentation of librato 0.1.0 Download librato 0.1.0 archive
0.0.3 May 12, 2015 Go to the documentation of librato 0.0.3 Download librato 0.0.3 archive
0.0.2+1 Jan 26, 2015 Go to the documentation of librato 0.0.2+1 Download librato 0.0.2+1 archive
0.0.2 Jan 23, 2015 Go to the documentation of librato 0.0.2 Download librato 0.0.2 archive
0.0.1+1 Jan 23, 2015 Go to the documentation of librato 0.0.1+1 Download librato 0.0.1+1 archive
0.0.1 Jan 23, 2015 Go to the documentation of librato 0.0.1 Download librato 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
--
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
--
Overall:
Weighted score of the above. [more]
0
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Health issues and suggestions

Fix lib/librato.dart. (-82.47 points)

Analysis of lib/librato.dart failed with 6 errors, 3 hints, including:

line 53 col 19: Undefined name 'JSON'.

line 72 col 19: Undefined name 'JSON'.

line 87 col 7: Undefined name 'BASE64'.

line 87 col 21: Undefined name 'UTF8'.

line 96 col 29: Undefined name 'UTF8'.

Maintenance issues and suggestions

Add SDK constraint in pubspec.yaml. (-50 points)

For information about setting SDK constraint, please see https://www.dartlang.org/tools/pub/pubspec#sdk-constraints.

Fix platform conflicts. (-20 points)

Low code quality prevents platform classification.

Running dartdoc failed. (-10 points)

Make sure dartdoc runs without any issues.

Package is getting outdated. (-58.90 points)

The package was released 82 weeks ago.

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Dependencies

Package Constraint Resolved Available
Dev dependencies
grinder ^0.8.0
test ^0.12.0