You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@skywalking.apache.org by peng-yongsheng <pe...@apache.org> on 2019/05/13 07:07:02 UTC

This is the most common metrics entity definition with the stream annotations.

This is the most common metrics entity definition with the stream
annotations.

@MetricsType
@StreamData
@StorageEntity(name = ServiceRelationClientSideMetrics.INDEX_NAME, builder =
ServiceRelationClientSideMetrics.Builder.class, sourceScopeId =
DefaultScopeDefine.SERVICE_RELATION)

@MetricsType: What model is streaming processing use? Other types are
@RecordType, @InventoryType, @TopNType.
@StreamData: Register this entity class into the remote module that makes
this entity could transfer between OAP server's nodes.
@StorageEntity: Identify the storage entity name, builder class for
serialization or deserialization this entity between memory and database.

Those three annotations look like having clear responsibilities, but if you
spend time to reflect on them, you will find that the @XXType's level is
higher than others.
- @MetricsType and @InventoryType are must include @StreamData and
@StorageEntity.
- @RecordType and @TopNType are must exclude @StreamData.

So, I suggest that let the @StreamData and @StorageEntity to be the
parameter of the @XXType.

For example:

@Stream(name = ServiceRelationClientSideMetrics.INDEX_NAME, scopeId =
DefaultScopeDefine.SERVICE_RELATION, storage = @Storage(builder =
ServiceRelationClientSideMetrics.Builder.class), kind = StreamKind.Metrics)
public class ServiceRelationClientSideMetrics extends Metrics {

Re: This is the most common metrics entity definition with the stream annotations.

Posted by Sheng Wu <wu...@gmail.com>.
Thanks for the details.
It makes sense to me.

Look forward your pull request about this refactor.

> 在 2019年5月13日,下午10:19,peng-yongsheng <pe...@apache.org> 写道:
> 
> Hi, Wu.
> 
> 1. Yes, the stream kind your guess is correct. Contains: Inventory, Record,
> TopN, Metrics.
> 2. Stream process loader flow is:
> Scan stream annotation -> get and parse the storage annotation -> process
> create (InventoryProcess, RecordProcess, TopNProcess, MetricsProcess)
> 
> Sheng Wu <wu...@gmail.com> 于2019年5月13日周一 下午8:46写道:
> 
>> Hi
>> 
>> From my understanding, all streaming models are going to base on `@Stream(
>> kind= xx)`,
>> Could you show, how many kinds of `@Stream`will we plan to use?
>> My guess
>> 1. Metrics
>> 2. Inventory
>> 3. Record
>> 4. TopN
>> 
>> Please correct me if I am wrong.
>> 
>> Sheng Wu 吴晟
>> 
>> Apache SkyWalking, ShardingSphere, Zipkin
>> Twitter, wusheng1108
>> 
>> 
>> peng-yongsheng <pe...@apache.org> 于2019年5月13日周一 下午3:07写道:
>> 
>>> This is the most common metrics entity definition with the stream
>>> annotations.
>>> 
>>> @MetricsType
>>> @StreamData
>>> @StorageEntity(name = ServiceRelationClientSideMetrics.INDEX_NAME,
>> builder
>>> =
>>> ServiceRelationClientSideMetrics.Builder.class, sourceScopeId =
>>> DefaultScopeDefine.SERVICE_RELATION)
>>> 
>>> @MetricsType: What model is streaming processing use? Other types are
>>> @RecordType, @InventoryType, @TopNType.
>>> @StreamData: Register this entity class into the remote module that makes
>>> this entity could transfer between OAP server's nodes.
>>> @StorageEntity: Identify the storage entity name, builder class for
>>> serialization or deserialization this entity between memory and database.
>>> 
>>> Those three annotations look like having clear responsibilities, but if
>> you
>>> spend time to reflect on them, you will find that the @XXType's level is
>>> higher than others.
>>> - @MetricsType and @InventoryType are must include @StreamData and
>>> @StorageEntity.
>>> - @RecordType and @TopNType are must exclude @StreamData.
>>> 
>>> So, I suggest that let the @StreamData and @StorageEntity to be the
>>> parameter of the @XXType.
>>> 
>>> For example:
>>> 
>>> @Stream(name = ServiceRelationClientSideMetrics.INDEX_NAME, scopeId =
>>> DefaultScopeDefine.SERVICE_RELATION, storage = @Storage(builder =
>>> ServiceRelationClientSideMetrics.Builder.class), kind =
>> StreamKind.Metrics)
>>> public class ServiceRelationClientSideMetrics extends Metrics {
>>> 
>> 


Re: This is the most common metrics entity definition with the stream annotations.

Posted by peng-yongsheng <pe...@apache.org>.
Hi, Wu.

1. Yes, the stream kind your guess is correct. Contains: Inventory, Record,
TopN, Metrics.
2. Stream process loader flow is:
Scan stream annotation -> get and parse the storage annotation -> process
create (InventoryProcess, RecordProcess, TopNProcess, MetricsProcess)

Sheng Wu <wu...@gmail.com> 于2019年5月13日周一 下午8:46写道:

> Hi
>
> From my understanding, all streaming models are going to base on `@Stream(
> kind= xx)`,
> Could you show, how many kinds of `@Stream`will we plan to use?
> My guess
> 1. Metrics
> 2. Inventory
> 3. Record
> 4. TopN
>
> Please correct me if I am wrong.
>
> Sheng Wu 吴晟
>
> Apache SkyWalking, ShardingSphere, Zipkin
> Twitter, wusheng1108
>
>
> peng-yongsheng <pe...@apache.org> 于2019年5月13日周一 下午3:07写道:
>
> > This is the most common metrics entity definition with the stream
> > annotations.
> >
> > @MetricsType
> > @StreamData
> > @StorageEntity(name = ServiceRelationClientSideMetrics.INDEX_NAME,
> builder
> > =
> > ServiceRelationClientSideMetrics.Builder.class, sourceScopeId =
> > DefaultScopeDefine.SERVICE_RELATION)
> >
> > @MetricsType: What model is streaming processing use? Other types are
> > @RecordType, @InventoryType, @TopNType.
> > @StreamData: Register this entity class into the remote module that makes
> > this entity could transfer between OAP server's nodes.
> > @StorageEntity: Identify the storage entity name, builder class for
> > serialization or deserialization this entity between memory and database.
> >
> > Those three annotations look like having clear responsibilities, but if
> you
> > spend time to reflect on them, you will find that the @XXType's level is
> > higher than others.
> > - @MetricsType and @InventoryType are must include @StreamData and
> > @StorageEntity.
> > - @RecordType and @TopNType are must exclude @StreamData.
> >
> > So, I suggest that let the @StreamData and @StorageEntity to be the
> > parameter of the @XXType.
> >
> > For example:
> >
> > @Stream(name = ServiceRelationClientSideMetrics.INDEX_NAME, scopeId =
> > DefaultScopeDefine.SERVICE_RELATION, storage = @Storage(builder =
> > ServiceRelationClientSideMetrics.Builder.class), kind =
> StreamKind.Metrics)
> > public class ServiceRelationClientSideMetrics extends Metrics {
> >
>

Re: This is the most common metrics entity definition with the stream annotations.

Posted by Sheng Wu <wu...@gmail.com>.
Hi

From my understanding, all streaming models are going to base on `@Stream(
kind= xx)`,
Could you show, how many kinds of `@Stream`will we plan to use?
My guess
1. Metrics
2. Inventory
3. Record
4. TopN

Please correct me if I am wrong.

Sheng Wu 吴晟

Apache SkyWalking, ShardingSphere, Zipkin
Twitter, wusheng1108


peng-yongsheng <pe...@apache.org> 于2019年5月13日周一 下午3:07写道:

> This is the most common metrics entity definition with the stream
> annotations.
>
> @MetricsType
> @StreamData
> @StorageEntity(name = ServiceRelationClientSideMetrics.INDEX_NAME, builder
> =
> ServiceRelationClientSideMetrics.Builder.class, sourceScopeId =
> DefaultScopeDefine.SERVICE_RELATION)
>
> @MetricsType: What model is streaming processing use? Other types are
> @RecordType, @InventoryType, @TopNType.
> @StreamData: Register this entity class into the remote module that makes
> this entity could transfer between OAP server's nodes.
> @StorageEntity: Identify the storage entity name, builder class for
> serialization or deserialization this entity between memory and database.
>
> Those three annotations look like having clear responsibilities, but if you
> spend time to reflect on them, you will find that the @XXType's level is
> higher than others.
> - @MetricsType and @InventoryType are must include @StreamData and
> @StorageEntity.
> - @RecordType and @TopNType are must exclude @StreamData.
>
> So, I suggest that let the @StreamData and @StorageEntity to be the
> parameter of the @XXType.
>
> For example:
>
> @Stream(name = ServiceRelationClientSideMetrics.INDEX_NAME, scopeId =
> DefaultScopeDefine.SERVICE_RELATION, storage = @Storage(builder =
> ServiceRelationClientSideMetrics.Builder.class), kind = StreamKind.Metrics)
> public class ServiceRelationClientSideMetrics extends Metrics {
>