Standard escape codes are prefixed with Escape
:
- Ctrl-Key:
^[
- Octal:
\033
- Unicode:
\u001b
- Hexadecimal:
\x1B
- Decimal:
27
#!/usr/bin/env ruby | |
# frozen_string_literal: true | |
statements = [{ input: 'SELECT this FROM there WHERE userId = 123 AND roleId = 456 LIMIT 11', | |
expected: 'SELECT this FROM there WHERE userId = ? AND roleId = ? LIMIT ?' }, | |
{ input: "SELECT this FROM there WHERE userId = 123 AND roleId = 456 LIMIT 11\n-- Linking id: 867", | |
expected: "SELECT this FROM there WHERE userId = ? AND roleId = ? LIMIT ?\n-- Linking id: 867" }, | |
{ input: "SELECT this FROM there WHERE userId = 123 /* linking id:\n867 */ AND roleId = 456 LIMIT 11", | |
expected: "SELECT this FROM there WHERE userId = ? /* linking id:\n867 */ AND roleId = ? LIMIT ?" }] |
#!/usr/bin/env ruby | |
# frozen_string_literal: true | |
# Instructions: | |
# 1. Copy a valid newrelic.yml file to the same directory as span_events.rb | |
# 2. Make sure at least the following parameters are set in newrelic.yml: | |
# - license_key: <your license key> | |
# - audit_log.enabled: true | |
# - span_events.max_samples_stored: 10000 | |
# 3. ruby span_events.rb |
New Relic's support for Ruby AWS Lambda functions is now out of beta and the instructions below should be considered out of date. Please see the official documentation for instructions on instrumenting your Lambda functions. When using the New Relic Lambda CLI tool, everything is automated. When manually introducing New Relic to your Lambda functions, please use one of the official New Relic Lambda layers instead of the .zip files contained in these beta test instructions.
These instructions will explain how to enhance an existing Ruby based AWS Lambda function to have it observed by New Relic.
# frozen_string_literal: true | |
source 'https://rubygems.org' | |
gem 'resque', '1.27.4' | |
gem 'newrelic_rpm' |
#!/usr/bin/env ruby | |
# frozen_string_literal: true | |
require 'webrick' | |
class FakeServlet < WEBrick::HTTPServlet::AbstractServlet | |
RESPONSE_BODY = "Success\n" | |
TEXT_PLAIN = 'text/plain' | |
def do_GET(_request, response) |
#!/usr/bin/env ruby | |
# frozen_string_literal: true | |
# Instructions: | |
# 1. Copy newrelic.yml with a valid license key to the same directory as | |
# standalone.rb | |
# 1. rm -rf log | |
# 2. ruby standalone.rb | |
# 3. inspect log/newrelic_agent.log |
#!/usr/bin/env ruby | |
# frozen_string_literal: true | |
# INSTRUCTIONS: | |
# - Place this file somewhere. It can be called something like `test.rb` | |
# | |
# - Either place a newrelic.yml file in the same directory as this file OR | |
# export the NEW_RELIC_LICENSE_KEY environment variable. For a | |
# non-production host, also export the NEW_RELIC_HOST environment variable. | |
# |