librato 0.1.0

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

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

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages 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

Analysis

We analyzed this package on Jun 12, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.60.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
23 / 100
Health:
Code health derived from static analysis. [more]
76 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
91 / 100
Overall score:
Weighted score of the above. [more]
53
Learn more about scoring.

Platforms

Detected platforms: Flutter, other

Primary library: package:librato/librato.dart with components: io.

Suggestions

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 1 error 5 hints.

    Strong-mode analysis of lib/librato.dart failed with the following error:

    line: 96 col: 63
    The return type 'void' isn't a 'List<int>', as defined by anonymous closure.

  • Package is getting outdated.

    The package was released 56 weeks ago.

  • The description is too short.

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

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

Dependencies

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