text: 'use strict';
  const INTERFACES = require('../enums').INTERFACES;
  const TRANSPORT = require('../enums').TRANSPORT;
  const Semver = require('semver');
  // TODO: ioredis module
  
  const Transports = require('../transports');
  
  module.exports = function (payload, ecoSystemInterface) {
  
      const request = payload.request;
      if (request !== 'redis') {
          return;
      }
  
      const instrumentation = ecoSystemInterface.getInterface(INTERFACES.INSTRUMENTATION);
      const transport = ecoSystemInterface.getInterface(INTERFACES.TRANSPORT);
      const module = payload.module;
      const identity = payload.identity;
      const moduleVersion = identity.version;
      const toWrap = [];
      if (Semver.satisfies(moduleVersion, '>2.5.3')) {
          toWrap.push('internal_send_command');
      }
      else {
          return; // TODO: later
          // toWrap.push('send_command');
      }
      // FIXME: migrate to wrap
      instrumentation.strategies.massWrap(module.RedisClient.prototype, toWrap, (self, args) => {
  
          const connectionOptions = self.connection_options;
          const todo = transport.shouldPropagate(TRANSPORT.SCOPE.CLIENT);
          const trigger = todo.trigger;
          const fields = todo.fields;
          if (fields.length === 0) {
              return; // Do nothing here
          }
          const resolved = new Transports.ClientTransport();
          resolved.addTransport(fields, TRANSPORT.TRANSPORT_TYPE.REDIS);
          resolved.addTA(fields, ecoSystemInterface);
          if (fields.indexOf('host') > -1) {
              resolved.host = connectionOptions.host;
          }
          resolved.addIP(fields, connectionOptions.host);
          const cleanup = transport.propagate(resolved, trigger);
          const cb = args[0].callback;
          if (typeof cb === 'function') { // TODO: utilitarize
              // we need to replace the last arg to place a spy on the callback resolution!
              const newCallback = function () {
  
                  cleanup();
                  return cb.apply(this, arguments);
              };
              args[0].callback = newCallback;
          }
  
      });
  };
  