<commit_before>require 'sinatra'
require 'json'
require 'ostruct'
require 'leafy-metrics'
require 'leafy-health'
require 'leafy/instrumented/instrumented'
require 'rack/leafy/admin'
require 'rack/leafy/instrumented'

data = OpenStruct.new
data.surname = 'meier'
data.firstname = 'christian'

configure do
  metrics = Leafy::Metrics::Registry.new
  health = Leafy::Health::Registry.new

  use Rack::Leafy::Admin, metrics, health
  use Rack::Leafy::Instrumented, Leafy::Instrumented::Instrumented.new( metrics, 'webapp' )

  metrics.register_gauge('app.data_length' ) do
    data.surname.length + data.firstname.length
  end

  health.register( 'app.health' ) do
    if data.surname.length + data.firstname.length < 4<commit_msg>use the right namespace - finally<commit_after>require 'sinatra'
require 'json'
require 'ostruct'
require 'leafy/metrics'
require 'leafy/health'
require 'leafy/instrumented/instrumented'
require 'leafy/rack/admin'
require 'leafy/rack/instrumented'

data = OpenStruct.new
data.surname = 'meier'
data.firstname = 'christian'

configure do
  metrics = Leafy::Metrics::Registry.new
  health = Leafy::Health::Registry.new

  use Leafy::Rack::Admin, metrics, health
  use Leafy::Rack::Instrumented, Leafy::Instrumented::Instrumented.new( metrics, 'webapp' )

  metrics.register_gauge('app.data_length' ) do
    data.surname.length + data.firstname.length
  end

  health.register( 'app.health' ) do
    if data.surname.length + data.firstname.length < 4
{'fraction_non_alphanumeric': 0.12686567164179105, 'fraction_numerical': 0.0013568521031207597, 'mean_word_length': 5.3852813852813854, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2632792', 'n_tokens_mistral': 526, 'n_tokens_neox': 495, 'n_words': 101}