Git Product home page Git Product logo

Comments (5)

udoprog avatar udoprog commented on May 27, 2024 1

Hey,

You are on the right track conceptually, but FilteringAggregation is not a great base for what you are trying to accomplish. I'd suggest investigating implementing a completely custom aggregation which wraps around Empty/EmptyInstance, and performs the delta's in the result method.

I realize this is what filtering aggregations do, but they are a bit more opinionated right now. What you do could be generalized into another aggregation archetype, maybe one that filtering should inherit from.

Good luck, and don't hesitate to follow up if you have more questions.

from heroic.

mykolasmith avatar mykolasmith commented on May 27, 2024

@udoprog Thanks, I'll keep you posted w/ progress & questions.

from heroic.

mykolasmith avatar mykolasmith commented on May 27, 2024

@udoprog I've created Delta / DeltaInstance classes that extend Empty / EmptyInstance. It seems that CollectorSession in EmptyInstance is a private static final class. I'm not sure how to override the result function of a private class from within an extending class. Apologies, I am not a Java developer =( Would you be so kind as to set up the next few lines?

public class DeltaInstance extends EmptyInstance { @JsonCreator public DeltaInstance() { super(); } }

from heroic.

udoprog avatar udoprog commented on May 27, 2024

There´s no need to extend EmptyInstance, you can keep it as a field of DeltaInstance.

public class DeltaInstance {
    private final EmptyInstance inner = Empty.INSTANCE;

    /* implement methods and delegate calls to inner */
}

This is basically how it's used in FilteringAggregation here:
https://github.com/spotify/heroic/blob/master/aggregation/simple/src/main/java/com/spotify/heroic/aggregation/simple/FilterAggregation.java#L82

from heroic.

mykolasmith avatar mykolasmith commented on May 27, 2024

I've got a working Delta aggregation and will open a pull request later today for further discussion.

from heroic.

Related Issues (20)

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.