 at 1st base” experiment, this was the type of season that ends a player’s career in baseball. There was a point in time where I thought Martin could have been our everyday 1st baseman, until he committed 3 errors in the 10 games he played there. I would be hard pressed to find another player who had the kind of regression that Maldonado had this season…maybe John Jaha? It was so bad, I wonder if Maldonado is even a lock to make the roster as the back-up catcher next season? My guess would be that he will have to re-earn his spot. This season could banish him to a career of Triple-A baseball, but we will have to see what the spring holds.
Maldonado has always been a good guy. Seems like a good teammate. Always had his head held high, despite his horrific performance this season. That is good enough for me. A guy who doesn’t cause problems, or invite conflict, gets no less than a B in my class.  If only that was enough to make up for that.169 batting average.
What a difference a year makes. As a 25-year-old, getting called up to filled Lucroy’s roster spot after Luggage-Gate, Maldonado had all of the promise in the world. As a 26-year-old making spot starts at catcher and first base, I can’t even believe this is the same player. The guy seemed to have no concept of the strike zone and was completely inept at working a count. That was evidence by his enormous dip in on-base percentage. And even though he struck out almost exactly the same number of times he did in 2012, this season it seemed like those always came with runners in scoring position. I winced whenever Maldy would step into the batters box late in a game. He left me little, if any, reason to think he could come through in a big situation based on every other at bat over the course of the season. You may be wondering why I didn’t fail him…well, it is because I think he is an excellent catcher. In my humble opinion, the kid calls a pretty nice game. That is an underrated skill in the game today.
At first, I thought it would be difficult to fail a Brewers player…but in fact it is not. After reading my own thoughts, I think it is safe to say that Maldonado was the least valuable player on this team (or “worst” for those of you playing the Home Edition). As a Brewers fan, I do not think that I would miss Maldonado if the Brewer cut him loose. As a Brewers writer, he is nothing more than a back-up catcher. Whether that is in Milwaukee or somewhere else. Martin would not be a starting catcher on any major league roster…unless you count the Astros as a major league team. This season was a real eye opener for this kid, and I do not believe that he has what it takes.<reponame>wehkamp/blaze-ideal-status-service
import requests
import os

from apscheduler.schedulers.background import BackgroundScheduler
from flask import Flask, Response
from flask import abort
from logging.config import dictConfig, logging
from prometheus_client.exposition import generate_latest
from prometheus_client.core import GaugeMetricFamily


SERVICE_PORT = os.environ.get('SERVICE_PORT', 5000)

dictConfig({
       'version': 1,
        'formatters': {
            'default': {
                'format': '[%(levelname)s] %(module)s: %(message)s',
            }
        },
        'handlers': {
            'wsgi': {
                'class': 'logging.StreamHandler',
               'stream': 'ext://sys.stdout',
                'formatter': 'default'
            }
        },
        'root': {
            'level': os.environ.get('LOG_LEVEL', 'INFO'),
            'handlers': ['wsgi']
        }
    })
logging.info('Logging environment ready')
logging.debug('Operating with level DEBUG enabled')
app = Flask(__name__)


class RegistryMock(object):
    def __init__(self, metrics):
        self.metrics = metrics

    def collect(self):
        for metric in self.metrics:
            yield metric


def update_latest():
    global latest_metrics
    metrics = {
        'ideal_issuer_availability': GaugeMetricFamily(
            'ideal_issuer_availability',
            'Availability of iDeal issuer, in percentage',
            labels=['bank_name']
        ),
        'ideal_acquirer_availability': GaugeMetricFamily(
            'ideal_acquirer_availability',
            'Availability of iDeal acquirer, in percentage',
            labels=['bank_name']
        ),
    }

    urls = [('ideal_acquirer_', 'https://beschikbaarheid.ideal.nl/api/api/GetAcquirers', 'Acquirers'),
            ('ideal_issuer_', 'https://beschikbaarheid.ideal.nl/api/api/GetIssuers', 'Issuers')]

    for m in urls:
        name = "{prefix}availability".format(prefix=m[0])
        url = m[1]
        search = m[2]
        r = requests.get(url).json()
        msg = r['Message']
        if msg:
            logging.info(msg)

        issuers = r[search]
        _ = list(map(lambda x: metrics[name].add_metric([x['BankName']], x['Percent'].replace(',', '.')), issuers))

    latest_metrics = generate_latest(RegistryMock(metrics.values()))


@app.route("/")
def home():
    abort(400)


@app.route("/status")
def status():
    return "OK"


@app.route("/metrics")
def metrics():
    return Response(latest_metrics, mimetype='text/plain')


def run():
    update_latest()

    scheduler = BackgroundScheduler({'apscheduler.timezone': 'UTC'})
    scheduler.add_job(update_latest, 'interval', seconds=60)
    scheduler.start()

    try:
        app.run(host="0.0.0.0", port=SERVICE_PORT, threaded=True)
    finally:
        scheduler.shutdown()
<commit_before>{
  "name": "trailpack-bookshelf",
  "version": "1.0.0-alpha-1",
  "description": "Bookshelf Trailpack",
  "homepage": "https://github.com/trailsjs/trailpack-bookshelf",
  "author": {
    "name": "<NAME>",
    "email": "<EMAIL>",
    "url": "http://zuker.github.io"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/trailsjs/trailpack-bookshelf.git"
  },
  "files": [
    "dist"
  ],
  "main": "dist/index.js",
  "keywords": [
    "trailpack",
    "trails",
    "trailjs"
  ],
  "dependencies": {
    "bluebird": "^3.3.1",
    "bookshelf": "^0.9.1",
    "bookshelf-schema": "^0.2.1",
    "joi": "^8.0.1",
    "knex": "^0.10.0",
    "lodash": "^4.5.0",
    "trailpack": "latest",
    "trailpack-datastore": "^1.0.0",
    "trails-service": "^1.0.0-beta-2"
  },
  "devDependencies": {
    "babel-cli": "^6.5.1",
    "babel-eslint": "^5.0.0",
    "babel-preset-es2015-node4": "^2.0.3",
    "babel-register": "^6.5.2",
    "chai": "^3.5.0",
    "chai-as-promised": "^5.2.0",
    "codecov": "^1.0.1",
    "eslint": "^2.2.0",
    "eslint-config-trails": "^1.0.4",
    "mocha": "^2.3",
    "nyc": "^6.0.0",
    "smokesignals": "^1.0.2",
    "sqlite3": "^3.1.1",
    "trailpack-core": "^1.