Git Product home page Git Product logo

lab_tech's Issues

README organization

  • move the "installation" section to the top LIKE A NORMAL GEM ;P
  • generate a TOC as with check_please

Significant compute consumption on main application thread

Prior to using LabTech, our Dyno Load on Heroku was a gentle 0.8~1.5 for our 1m load average.

Once installing LabTech and running an experiment which accumulated 2.5M observations over the course of a week, our 1m avg dyno load increased to 6~8!

On the one hand, this may mean that we have reached ROFLSCALE and would be better equipped by the scientist package directly.

On the other hand, it seems possible that pulling the complex computations onto the application's Background Job queue could be sufficient to raise the ceiling at which folks need to expand their infrastructure footprint.

It's unlikely I'll take the time to identify and make the adjustment, but maybe @bhaibel will take a stab if we decide to stay on LabTech.

ArgumentError: No text type has byte size 4294967295. The limit on text can be at most 1GB - 1byte.

I just added LabTech to my Rails project and getting this error on migration.

Caused by this line:

t.text "value", limit: 4294967295

Changing it to t.text "value", limit: 1.gigabyte - 1.byte will help in my case.

I am working on macOS with M1 chip and Docker:
ruby 3.0.4p208 (2022-04-12 revision 3fa771dded) [x86_64-linux]
Rails 6.1.6
lab_tech 0.1.9
scientist 1.6.3

Maybe related to my postgis 14.3.2 on Alpine?

`compare` doesn't work with scientist version higher than 1.6.0

I have written an experiment to compare the output of 2 rails serializers (lightly edited from the production code, but the logic is identical):

def index
    LabTech.science 'PagesController#index' do |experiment|
      experiment.use do
        @pages = Page.all
        @json = ActiveModelSerializers::SerializableResource.new(@pages, each_serializer: PageSerializer, root: 'pages', include: '**').as_json
      end
      experiment.try do
        @json = { pages: QueryService.all_pages }.as_json
      end

      experiment.context params: page_params.to_h
      experiment.compare do |control, candidate|
        control_8601 = control[:pages].map { |hash| hash.deep_transform_values! { |value| value.is_a?(ActiveSupport::TimeWithZone) ? value.iso8601(3).to_s : value } }
        # binding.pry
        control_8601.to_json == candidate['pages'].to_json
      end
      experiment.clean { |value| value.with_indifferent_access[:pages] }
    end
    render json: @json
  end

When I uncomment the binding.pry and check control_8601.to_json == candidate['pages'].to_json, I get true. But when I get the summarized_results, they are always marked as mismatched (this is in my dev environment):

> LabTech.summarize_results 'PagesController#index'

--------------------------------------------------------------------------------
Experiment: PagesController#index
--------------------------------------------------------------------------------
Earliest results: 2023-07-21T22:03:56Z
Latest result:    2023-08-09T05:19:14Z (18 days)

24 of 24 (100.00%) mismatched
--------------------------------------------------------------------------------

When I check LabTech.compare_mismatches 'PagesController#index', there is no difference between the control and candidate.

I'm running the comparison with the deep_transform_values because in my control, the created_at value is coming back as an ActiveSupport::TimeWithZone and in the candidate it is returned as a string - that's the only difference between the two that I can find, however they seem to be identical after the transform. I has noticed this before doing the transform, compare_mismatches would still come back without any difference, so my theory is that once serialized to Postgres and deserialized later, the dates would be normalized.

My Gemfile.lock has the latest versions of the gems:

lab_tech (0.1.9)
scientist (1.6.4)

What am I doing wrong here? Or is there a bug? Could this be related to #41?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.